chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/course_description.lib.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '52', column '29').
Open

            $desc_tmp = new CourseDescription();

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method get_descriptions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return [];
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method insert uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $course_id = $this->course_id;
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method get_max_description_type uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $description_type = $max['MAX'] + 1;
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$session_id'.
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$course_code'.
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

The property $course_id is not named in camelCase.
Open

class CourseDescription
{
    private $id;
    private $course_id;
    private $title;

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The property $session_id is not named in camelCase.
Open

class CourseDescription
{
    private $id;
    private $course_id;
    private $title;

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $description_type is not named in camelCase.
Open

    public function get_data_by_description_type(
        $description_type,
        $courseId = null,
        $session_id = null
    ) {

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The property $description_type is not named in camelCase.
Open

class CourseDescription
{
    private $id;
    private $course_id;
    private $title;

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $session_id is not named in camelCase.
Open

    public function get_data_by_description_type(
        $description_type,
        $courseId = null,
        $session_id = null
    ) {

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $session_id is not named in camelCase.
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)
    {
        $description = Container::getCourseDescriptionRepository()->find($id);

        $data = [];

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $course_id is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $session_id is not named in camelCase.
Open

    public function set_session_id($session_id)
    {
        $this->session_id = $session_id;
    }

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $course_code is not named in camelCase.
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)
    {
        $description = Container::getCourseDescriptionRepository()->find($id);

        $data = [];

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $description_type is not named in camelCase.
Open

    public function set_description_type($description_type)
    {
        $this->description_type = $description_type;
    }

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Variable "desc_tmp" is not in valid camel caps format
Open

            $desc_tmp->set_session_id($row['session_id']);

Variable "desc_tmp" is not in valid camel caps format
Open

            $results[] = $desc_tmp;

Variable "session_id" is not in valid camel caps format
Open

            api_get_session_entity($session_id),

Variable "description_type" is not in valid camel caps format
Open

            $description_type = ADD_BLOCK;

Variable "course_id" is not in valid camel caps format
Open

        $course_id = (int) $course_id;

Variable "course_id" is not in valid camel caps format
Open

            $course_id = $this->course_id;

Variable "course_id" is not in valid camel caps format
Open

        $course = api_get_course_entity($course_id);

Variable "description_type" is not in valid camel caps format
Open

            ->setDescriptionType((int) $this->description_type)

Variable "session_id" is not in valid camel caps format
Open

        $session = api_get_session_entity($this->session_id);

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[3] = get_lang('Topics');

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[6] = get_lang('Resources');

Method name "CourseDescription::get_descriptions" is not in camel caps format
Open

    public static function get_descriptions($course_id)

Variable "course_id" is not in valid camel caps format
Open

    public static function get_descriptions($course_id)

Variable "session_id" is not in valid camel caps format
Open

        $session = api_get_session_entity($this->session_id);

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles = [];

Variable "course_id" is not in valid camel caps format
Open

        $course_info = api_get_course_info_by_id($course_id);

Variable "desc_tmp" is not in valid camel caps format
Open

            $desc_tmp->set_id($row['iid']);

Variable "desc_tmp" is not in valid camel caps format
Open

            $desc_tmp->set_title($row['title']);

Variable "course_id" is not in valid camel caps format
Open

                    $this->course_id ? $this->course_id : api_get_course_int_id(),

Variable "sql_result" is not in valid camel caps format
Open

        $sql_result = Database::query($sql);

Variable "desc_tmp" is not in valid camel caps format
Open

            $desc_tmp->set_description_type($row['description_type']);

Variable "description_type" is not in valid camel caps format
Open

            (int) $description_type,

Method name "CourseDescription::get_data_by_description_type" is not in camel caps format
Open

    public function get_data_by_description_type(

Variable "session_id" is not in valid camel caps format
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)

Variable "course_id" is not in valid camel caps format
Open

            $course_id = api_get_course_int_id();

Variable "course_id" is not in valid camel caps format
Open

                    $this->course_id ? $this->course_id : api_get_course_int_id(),

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[5] = get_lang('Course material');

Variable "course_info" is not in valid camel caps format
Open

        $course_info = api_get_course_info_by_id($course_id);

Method name "CourseDescription::get_data_by_id" is not in camel caps format
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)

Variable "description_type" is not in valid camel caps format
Open

            $description_type = 8;

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[1] = get_lang('Description');

Variable "course_info" is not in valid camel caps format
Open

        if (!empty($course_info)) {

Variable "desc_tmp" is not in valid camel caps format
Open

            $desc_tmp->set_progress($row['progress']);

Variable "description_type" is not in valid camel caps format
Open

        if ($description_type < ADD_BLOCK) {

Variable "course_id" is not in valid camel caps format
Open

            $course_id = $course_info['real_id'];

Variable "course_id" is not in valid camel caps format
Open

        $course_id = $this->course_id ?: api_get_course_int_id();

Method name "CourseDescription::get_max_description_type" is not in camel caps format
Open

    public function get_max_description_type()

Variable "course_id" is not in valid camel caps format
Open

            $course_id = $this->course_id;

Missing function doc comment
Open

    public function __construct()

Variable "course_code" is not in valid camel caps format
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[8] = get_lang('Other');

Variable "default_description_titles" is not in valid camel caps format
Open

        return $default_description_titles;

Method name "CourseDescription::get_default_description_title_editable" is not in camel caps format
Open

    public function get_default_description_title_editable()

Variable "course_info" is not in valid camel caps format
Open

            $course_id = $course_info['real_id'];

Variable "desc_tmp" is not in valid camel caps format
Open

            $desc_tmp->set_content($row['content']);

Method name "CourseDescription::get_description_data" is not in camel caps format
Open

    public function get_description_data()

Variable "course_id" is not in valid camel caps format
Open

        $course = api_get_course_entity($course_id);

Variable "session_id" is not in valid camel caps format
Open

        $session_id = null

Variable "desc_tmp" is not in valid camel caps format
Open

            $desc_tmp = new CourseDescription();

Variable "description_type" is not in valid camel caps format
Open

            $description_type = $max['MAX'] + 1;

Variable "description_type" is not in valid camel caps format
Open

        return $description_type;

Variable "course_id" is not in valid camel caps format
Open

        if (empty($this->course_id)) {

Method name "CourseDescription::get_default_description_icon" is not in camel caps format
Open

    public function get_default_description_icon()

Variable "description_type" is not in valid camel caps format
Open

        $this->description_type = $description_type;

Method name "CourseDescription::get_progress" is not in camel caps format
Open

    public function get_progress()

Method name "CourseDescription::get_default_description_title" is not in camel caps format
Open

    public function get_default_description_title()

Variable "sql_result" is not in valid camel caps format
Open

        while ($row = Database::fetch_array($sql_result)) {

Variable "description_type" is not in valid camel caps format
Open

        $description_type,

Variable "session_id" is not in valid camel caps format
Open

                    $this->session_id,

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[2] = get_lang('Objectives');

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[4] = get_lang('Methodology');

Variable "default_description_titles" is not in valid camel caps format
Open

        $default_description_titles[7] = get_lang('Assessment');

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable = [];

Variable "course_id" is not in valid camel caps format
Open

        $this->course_id = intval($id);

Variable "session_id" is not in valid camel caps format
Open

        $this->session_id = $session_id;

Variable "session_id" is not in valid camel caps format
Open

        return $this->session_id;

Variable "description_type" is not in valid camel caps format
Open

        return $this->description_type;

Variable "course_id" is not in valid camel caps format
Open

        $course_id = (int) $course_id;

Variable "course_id" is not in valid camel caps format
Open

        $course_id = $this->course_id ?: api_get_course_int_id();

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable[5] = true;

Variable "default_description_title_editable" is not in valid camel caps format
Open

        return $default_description_title_editable;

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[6] = 'human-male-board';

Method name "CourseDescription::set_title" is not in camel caps format
Open

    public function set_title($title)

Method name "CourseDescription::get_description_type" is not in camel caps format
Open

    public function get_description_type()

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable[2] = true;

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable[1] = true;

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable[7] = true;

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[1] = 'image-text';

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[3] = 'table-of-contents';

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[7] = 'order-bool-ascending-variant';

Method name "CourseDescription::set_content" is not in camel caps format
Open

    public function set_content($content)

Variable "description_type" is not in valid camel caps format
Open

        $this->description_type = $description_type;

Method name "CourseDescription::get_content" is not in camel caps format
Open

    public function get_content()

Variable "session_id" is not in valid camel caps format
Open

    public function set_session_id($session_id)

Method name "CourseDescription::get_id" is not in camel caps format
Open

    public function get_id()

Method name "CourseDescription::get_title" is not in camel caps format
Open

    public function get_title()

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable[6] = true;

Method name "CourseDescription::set_description_type" is not in camel caps format
Open

    public function set_description_type($description_type)

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[2] = 'flag-checkered';

Method name "CourseDescription::get_default_question" is not in camel caps format
Open

    public function get_default_question()

Method name "CourseDescription::get_default_information" is not in camel caps format
Open

    public function get_default_information()

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[5] = 'laptop';

Method name "CourseDescription::set_session_id" is not in camel caps format
Open

    public function set_session_id($session_id)

Method name "CourseDescription::get_session_id" is not in camel caps format
Open

    public function get_session_id()

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable[3] = true;

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[4] = 'strategy';

Method name "CourseDescription::set_id" is not in camel caps format
Open

    public function set_id($id)

Variable "description_type" is not in valid camel caps format
Open

    public function set_description_type($description_type)

Variable "default_description_title_editable" is not in valid camel caps format
Open

        $default_description_title_editable[4] = true;

Variable "session_id" is not in valid camel caps format
Open

        $this->session_id = $session_id;

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon = [];

Variable "default_description_icon" is not in valid camel caps format
Open

        $default_description_icon[8] = 'magic-staff';

Variable "default_description_icon" is not in valid camel caps format
Open

        return $default_description_icon;

Method name "CourseDescription::set_course_id" is not in camel caps format
Open

    public function set_course_id($id)

Method name "CourseDescription::set_progress" is not in camel caps format
Open

    public function set_progress($progress)

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $description_type is not named in camelCase.
Open

    public function set_description_type($description_type)
    {
        $this->description_type = $description_type;
    }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $session_id is not named in camelCase.
Open

    public function set_session_id($session_id)
    {
        $this->session_id = $session_id;
    }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $sql_result is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $description_type is not named in camelCase.
Open

    public function get_max_description_type()
    {
        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);

        $sql = "SELECT MAX(description_type) as MAX

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $description_type is not named in camelCase.
Open

    public function get_max_description_type()
    {
        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);

        $sql = "SELECT MAX(description_type) as MAX

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $session_id is not named in camelCase.
Open

    public function get_data_by_description_type(
        $description_type,
        $courseId = null,
        $session_id = null
    ) {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_info is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $description_type is not named in camelCase.
Open

    public function get_data_by_description_type(
        $description_type,
        $courseId = null,
        $session_id = null
    ) {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $description_type is not named in camelCase.
Open

    public function get_max_description_type()
    {
        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);

        $sql = "SELECT MAX(description_type) as MAX

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public function insert()
    {
        if (empty($this->course_id)) {
            $course_id = api_get_course_int_id();
        } else {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $sql_result is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public function get_description_data()
    {
        $repo = Container::getCourseDescriptionRepository();
        $course_id = $this->course_id ?: api_get_course_int_id();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $description_type is not named in camelCase.
Open

    public function get_max_description_type()
    {
        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);

        $sql = "SELECT MAX(description_type) as MAX

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_info is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $desc_tmp is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $description_type is not named in camelCase.
Open

    public function get_max_description_type()
    {
        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);

        $sql = "SELECT MAX(description_type) as MAX

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public function insert()
    {
        if (empty($this->course_id)) {
            $course_id = api_get_course_int_id();
        } else {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $default_description_titles is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_info is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public function get_description_data()
    {
        $repo = Container::getCourseDescriptionRepository();
        $course_id = $this->course_id ?: api_get_course_int_id();

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $course_id is not named in camelCase.
Open

    public function insert()
    {
        if (empty($this->course_id)) {
            $course_id = api_get_course_int_id();
        } else {

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The method set_title is not named in camelCase.
Open

    public function set_title($title)
    {
        $this->title = $title;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_default_information is not named in camelCase.
Open

    public function get_default_information()
    {
        $information = [];
        $information[1] = get_lang('DescriptionInformation');
        $information[2] = get_lang('What are the objectives of the course (competences, skills, outcomes)?');

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_max_description_type is not named in camelCase.
Open

    public function get_max_description_type()
    {
        $table = Database::get_course_table(TABLE_COURSE_DESCRIPTION);

        $sql = "SELECT MAX(description_type) as MAX

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_default_description_icon is not named in camelCase.
Open

    public function get_default_description_icon()
    {
        $default_description_icon = [];
        $default_description_icon[1] = 'image-text';
        $default_description_icon[2] = 'flag-checkered';

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_progress is not named in camelCase.
Open

    public function get_progress()
    {
        return $this->progress;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_description_data is not named in camelCase.
Open

    public function get_description_data()
    {
        $repo = Container::getCourseDescriptionRepository();
        $course_id = $this->course_id ?: api_get_course_int_id();

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_data_by_id is not named in camelCase.
Open

    public function get_data_by_id($id, $course_code = '', $session_id = null)
    {
        $description = Container::getCourseDescriptionRepository()->find($id);

        $data = [];

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_title is not named in camelCase.
Open

    public function get_title()
    {
        return $this->title;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_session_id is not named in camelCase.
Open

    public function get_session_id()
    {
        return $this->session_id;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_session_id is not named in camelCase.
Open

    public function set_session_id($session_id)
    {
        $this->session_id = $session_id;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_id is not named in camelCase.
Open

    public function set_id($id)
    {
        $this->id = $id;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_content is not named in camelCase.
Open

    public function get_content()
    {
        return $this->content;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_default_description_title is not named in camelCase.
Open

    public function get_default_description_title()
    {
        $default_description_titles = [];
        $default_description_titles[1] = get_lang('Description');
        $default_description_titles[2] = get_lang('Objectives');

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_content is not named in camelCase.
Open

    public function set_content($content)
    {
        $this->content = $content;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_course_id is not named in camelCase.
Open

    public function set_course_id($id)
    {
        $this->course_id = intval($id);
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_description_type is not named in camelCase.
Open

    public function get_description_type()
    {
        return $this->description_type;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_data_by_description_type is not named in camelCase.
Open

    public function get_data_by_description_type(
        $description_type,
        $courseId = null,
        $session_id = null
    ) {

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_default_description_title_editable is not named in camelCase.
Open

    public function get_default_description_title_editable()
    {
        $default_description_title_editable = [];
        $default_description_title_editable[1] = true;
        $default_description_title_editable[2] = true;

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_progress is not named in camelCase.
Open

    public function set_progress($progress)
    {
        $this->progress = $progress;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_id is not named in camelCase.
Open

    public function get_id()
    {
        return $this->id;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_descriptions is not named in camelCase.
Open

    public static function get_descriptions($course_id)
    {
        $course_id = (int) $course_id;
        // Get course code
        $course_info = api_get_course_info_by_id($course_id);

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_default_question is not named in camelCase.
Open

    public function get_default_question()
    {
        $question = [];
        $question[1] = get_lang('DescriptionQuestions');
        $question[2] = get_lang('What should the end results be when the learner has completed the course? What are the activities performed during the course?');

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_description_type is not named in camelCase.
Open

    public function set_description_type($description_type)
    {
        $this->description_type = $description_type;
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status