chamilo/chamilo-lms

View on GitHub
public/main/gradebook/lib/scoredisplay.class.php

Summary

Maintainability
A
0 mins
Test Coverage

The method __construct() has an NPath complexity of 2184. The configured NPath complexity threshold is 200.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_id;
        }

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method display_score() has an NPath complexity of 240. The configured NPath complexity threshold is 200.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

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

            $instance = new ScoreDisplay($categoryId);

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

Missing class import via use statement (line '486', column '26').
Open

                $f = new NumberFormatter($iso, NumberFormatter::SPELLOUT);

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 display_score uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // if no custom display set, use default display
            $display = $this->displayDefault($my_score, $type, $ignoreDecimals, $removeEmptyDecimals);
        }

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 updateCustomScoreDisplaySettings uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $category_id = $this->get_current_gradebook_category_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 display_custom uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            if (!empty($this->custom_display_conv)) {
                foreach ($this->custom_display_conv as $displayitem) {
                    if ($scaledscore < $displayitem['score'] || 1 == $displayitem['score']) {
                        return $displayitem['display'];

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_custom_displays uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $category_id = $this->get_current_gradebook_category_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 convert_displays uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $newelement['score'] = 0;
                }

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_score_color_percent uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $category_id = $this->get_current_gradebook_category_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 sort_display uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return $item1['score'] < $item2['score'] ? -1 : 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 '$what'.
Open

        $what = SCORE_BOTH,

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 private methods such as 'sort_display'.
Open

    private function sort_display($item1, $item2)
    {
        if ($item1['score'] === $item2['score']) {
            return 0;
        } else {

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

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

The property $color_split_value is not named in camelCase.
Open

class ScoreDisplay
{
    private $coloring_enabled;
    private $color_split_value;
    private $custom_enabled;

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 $custom_display is not named in camelCase.
Open

class ScoreDisplay
{
    private $coloring_enabled;
    private $color_split_value;
    private $custom_enabled;

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 $category_id is not named in camelCase.
Open

    public function insert_defaults($category_id)
    {
        if (empty($category_id)) {
            return false;
        }

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 $upperlimit_included is not named in camelCase.
Open

class ScoreDisplay
{
    private $coloring_enabled;
    private $color_split_value;
    private $custom_enabled;

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 $custom_enabled is not named in camelCase.
Open

class ScoreDisplay
{
    private $coloring_enabled;
    private $color_split_value;
    private $custom_enabled;

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 $category_id is not named in camelCase.
Open

    public function updateCustomScoreDisplaySettings(
        $displays,
        $scorecolpercent = 0,
        $category_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 $coloring_enabled is not named in camelCase.
Open

class ScoreDisplay
{
    private $coloring_enabled;
    private $color_split_value;
    private $custom_enabled;

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 $category_id is not named in camelCase.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_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 property $custom_display_conv is not named in camelCase.
Open

class ScoreDisplay
{
    private $coloring_enabled;
    private $color_split_value;
    private $custom_enabled;

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 $category_id is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $custom_display is not named in camelCase.
Open

    private function convert_displays($custom_display)
    {
        if (isset($custom_display)) {
            // get highest score entry, and copy each element to a new array
            $converted = [];

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 "coloring_enabled" is not in valid camel caps format
Open

        $this->coloring_enabled = 'true' == $value ? true : false;

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

                $this->upperlimit_included = 'true' === $value ? true : false;

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

            if ($this->custom_enabled) {

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

                if (count($this->custom_display) > 0) {

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

                $this->color_split_value = $this->get_score_color_percent();

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

        return $this->coloring_enabled;

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

        return $this->custom_enabled;

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

                'category_id' => $category_id,

Method name "ScoreDisplay::display_score" is not in camel caps format
Open

    public function display_score(

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

                $percentage = $my_score[0] / $my_score[1] * 100;

Method name "ScoreDisplay::get_score_color_percent" is not in camel caps format
Open

    private function get_score_color_percent($category_id = null)

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

        $sql = 'SELECT score_color_percent FROM '.$tbl_display.'

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

        if (!empty($category_id)) {

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

            $this->custom_display = $portal_displays;

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

                WHERE category_id = '.$category_id.'

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

            foreach ($custom_display as $element) {

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

                $this->color_split_value = $value;

Method name "ScoreDisplay::get_custom_score_display_settings" is not in camel caps format
Open

    public function get_custom_score_display_settings()

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

        if (isset($category_id)) {

Method name "ScoreDisplay::insert_defaults" is not in camel caps format
Open

    public function insert_defaults($category_id)

Method name "ScoreDisplay::get_number_decimals" is not in camel caps format
Open

    public function get_number_decimals()

Missing parameter name
Open

     * @param int   gradebook category id (optional)

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

        if ($this->upperlimit_included) {

Method name "ScoreDisplay::format_score" is not in camel caps format
Open

    public function format_score(

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

            $category_id = $this->get_current_gradebook_category_id();

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

        $my_score = 0 == $score ? [] : $score;

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

                    $my_score[0] = 0;

Method name "ScoreDisplay::get_custom_displays" is not in camel caps format
Open

    private function get_custom_displays($category_id = null)

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

                $this->custom_display = $this->get_custom_displays();

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

                    $this->custom_display_conv = $this->convert_displays($this->custom_display);

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

            $category_id = (int) $category_id;

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

        $sql = 'SELECT * FROM '.$tbl_display.'

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

            $this->custom_display = $portal_displays;

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

                'category_id' => $category_id,

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

                $percentage = $my_score[0] / $my_score[1] * 100;

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

        if (isset($category_id)) {

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

            $category_id = (int) $category_id;

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

            $portal_displays = [];

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

                sort($portal_displays);

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

                $this->custom_display_conv = $this->convert_displays($this->custom_display);

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

        return $this->custom_display;

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

        return $this->color_split_value;

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

        if ($this->custom_enabled && isset($this->custom_display_conv)) {

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

            $display = $this->displayDefault($my_score, $type, $ignoreDecimals, $removeEmptyDecimals);

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

        if ($this->coloring_enabled && false == $disableColor) {

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

        if ($this->custom_enabled) {

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

            $number_decimals = 0;

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

                $percentage = $my_score[0] / $my_score[1] * 100;

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

            if (($scoreCleaned / $denom) < ($this->color_split_value / 100)) {

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

            foreach ($this->custom_display_conv as $displayitem) {

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

                foreach ($this->custom_display_conv as $displayitem) {

Method name "ScoreDisplay::display_as_decimal" is not in camel caps format
Open

    private function display_as_decimal($score)

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

    private function get_score_color_percent($category_id = null)

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

        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);

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

            $category_id = (int) $category_id;

Method name "ScoreDisplay::convert_displays" is not in camel caps format
Open

    private function convert_displays($custom_display)

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

        if (isset($custom_display)) {

Method name "ScoreDisplay::compare_scores_by_custom_display" is not in camel caps format
Open

    public static function compare_scores_by_custom_display($score1, $score2)

Method name "ScoreDisplay::get_color_split_value" is not in camel caps format
Open

    public function get_color_split_value()

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

            $category_id = (int) $category_id;

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

    private function get_custom_displays($category_id = null)

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

        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);

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

            $category_id = (int) $category_id;

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

    public function __construct($category_id = 0)

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

        if ($this->coloring_enabled) {

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

        return $this->upperlimit_included;

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

                $percentage = $my_score[0] / $my_score[1] * 100;

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

                return $this->format_score($my_score[0], $ignoreDecimals);

Method name "ScoreDisplay::display_as_percent" is not in camel caps format
Open

    private function display_as_percent($score)

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

    private function convert_displays($custom_display)

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

                $this->custom_display_conv = $this->convert_displays($this->custom_display);

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

        $this->custom_display = $displays;

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

        if (empty($category_id)) {

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

            if (!empty($this->custom_display_conv)) {

Method name "ScoreDisplay::display_simple_score" is not in camel caps format
Open

    private function display_simple_score($score)

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

                WHERE category_id = '.$category_id.'

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

            if ($this->coloring_enabled) {

Method name "ScoreDisplay::is_coloring_enabled" is not in camel caps format
Open

    public function is_coloring_enabled()

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

    public function insert_defaults($category_id)

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

        $number_decimals = api_get_setting('gradebook_number_decimals');

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

        if ($this->custom_enabled && isset($this->custom_display_conv)) {

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

        return $this->format_score($score[0] / $score_denom);

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

            $category_id = $this->get_current_gradebook_category_id();

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

        $this->custom_enabled = 'true' == $value ? true : false;

Method name "ScoreDisplay::is_custom" is not in camel caps format
Open

    public function is_custom()

Method name "ScoreDisplay::is_upperlimit_included" is not in camel caps format
Open

    public function is_upperlimit_included()

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

            $display = $this->displayDefault($my_score, $type, $ignoreDecimals, $removeEmptyDecimals);

Method name "ScoreDisplay::display_as_div" is not in camel caps format
Open

    private function display_as_div($score, $ignoreDecimals = false, $removeEmptyDecimals = false)

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

            $category_id = (int) $category_id;

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

            $this->category_id = $category_id;

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

            if (count($this->custom_display) > 0) {

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

        $sql = 'DELETE FROM '.$table.' WHERE category_id = '.$category_id;

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

                if (!isset($my_score[0])) {

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

        $score_denom = (0 == $score[1]) ? 1 : $score[1];

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

        if (isset($category_id)) {

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

            $this->category_id = $category_id;

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

                    $this->custom_display_conv = $this->convert_displays($this->custom_display);

Expected 34 spaces after parameter type; 1 found
Open

     * @param array $displays 2-dimensional array - every sub array must have keys (score, display)

Missing parameter name
Open

     * @param int   score color percent (optional)

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

        $this->custom_display_conv = $this->convert_displays($this->custom_display);

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

        return $number_decimals;

Missing function doc comment
Open

    public static function hasEmptyDecimals($score)

Method name "ScoreDisplay::display_custom" is not in camel caps format
Open

    public function display_custom($score)

Method name "ScoreDisplay::get_current_gradebook_category_id" is not in camel caps format
Open

    private function get_current_gradebook_category_id()

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

                    $portal_displays[$data[0]] = [

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

        $category_id = null

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

        $this->custom_display_conv = $this->convert_displays($this->custom_display);

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

            $category_id = $this->get_current_gradebook_category_id();

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

        if (!isset($number_decimals)) {

Method name "ScoreDisplay::sort_display" is not in camel caps format
Open

    private function sort_display($item1, $item2)

The variable $portal_displays is not named in camelCase.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $category_id is not named in camelCase.
Open

    public function updateCustomScoreDisplaySettings(
        $displays,
        $scorecolpercent = 0,
        $category_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 $portal_displays is not named in camelCase.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_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 $category_id is not named in camelCase.
Open

    public function insert_defaults($category_id)
    {
        if (empty($category_id)) {
            return false;
        }

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 $score_denom is not named in camelCase.
Open

    private function display_as_decimal($score)
    {
        $score_denom = (0 == $score[1]) ? 1 : $score[1];

        return $this->format_score($score[0] / $score_denom);

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 $score_denom is not named in camelCase.
Open

    private function display_as_decimal($score)
    {
        $score_denom = (0 == $score[1]) ? 1 : $score[1];

        return $this->format_score($score[0] / $score_denom);

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $category_id is not named in camelCase.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_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 $portal_displays is not named in camelCase.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_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 $portal_displays is not named in camelCase.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_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 $number_decimals is not named in camelCase.
Open

    public function get_number_decimals()
    {
        $number_decimals = api_get_setting('gradebook_number_decimals');
        if (!isset($number_decimals)) {
            $number_decimals = 0;

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $category_id is not named in camelCase.
Open

    public function __construct($category_id = 0)
    {
        if (!empty($category_id)) {
            $this->category_id = $category_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 $category_id is not named in camelCase.
Open

    public function updateCustomScoreDisplaySettings(
        $displays,
        $scorecolpercent = 0,
        $category_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 $category_id is not named in camelCase.
Open

    public function updateCustomScoreDisplaySettings(
        $displays,
        $scorecolpercent = 0,
        $category_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 $category_id is not named in camelCase.
Open

    public function updateCustomScoreDisplaySettings(
        $displays,
        $scorecolpercent = 0,
        $category_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 $number_decimals is not named in camelCase.
Open

    public function get_number_decimals()
    {
        $number_decimals = api_get_setting('gradebook_number_decimals');
        if (!isset($number_decimals)) {
            $number_decimals = 0;

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $category_id is not named in camelCase.
Open

    public function updateCustomScoreDisplaySettings(
        $displays,
        $scorecolpercent = 0,
        $category_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 $number_decimals is not named in camelCase.
Open

    public function get_number_decimals()
    {
        $number_decimals = api_get_setting('gradebook_number_decimals');
        if (!isset($number_decimals)) {
            $number_decimals = 0;

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $category_id is not named in camelCase.
Open

    public function updateCustomScoreDisplaySettings(
        $displays,
        $scorecolpercent = 0,
        $category_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 $category_id is not named in camelCase.
Open

    public function insert_defaults($category_id)
    {
        if (empty($category_id)) {
            return false;
        }

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 $number_decimals is not named in camelCase.
Open

    public function get_number_decimals()
    {
        $number_decimals = api_get_setting('gradebook_number_decimals');
        if (!isset($number_decimals)) {
            $number_decimals = 0;

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 $my_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 $category_id is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $tbl_display is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $tbl_display is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $custom_display is not named in camelCase.
Open

    private function convert_displays($custom_display)
    {
        if (isset($custom_display)) {
            // get highest score entry, and copy each element to a new array
            $converted = [];

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 $category_id is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $custom_display is not named in camelCase.
Open

    private function convert_displays($custom_display)
    {
        if (isset($custom_display)) {
            // get highest score entry, and copy each element to a new array
            $converted = [];

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 $tbl_display is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $tbl_display is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 $category_id is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 method get_current_gradebook_category_id is not named in camelCase.
Open

    private function get_current_gradebook_category_id()
    {
        $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
        $courseId = api_get_course_int_id();
        $sessionId = api_get_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 display_simple_score is not named in camelCase.
Open

    private function display_simple_score($score)
    {
        if (isset($score[0])) {
            return $this->format_score($score[0]);
        }

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 format_score is not named in camelCase.
Open

    public function format_score(
        $score,
        $ignoreDecimals = false,
        $decimalSeparator = '.',
        $thousandSeparator = ',',

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 is_coloring_enabled is not named in camelCase.
Open

    public function is_coloring_enabled()
    {
        return $this->coloring_enabled;
    }

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_custom_score_display_settings is not named in camelCase.
Open

    public function get_custom_score_display_settings()
    {
        return $this->custom_display;
    }

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 insert_defaults is not named in camelCase.
Open

    public function insert_defaults($category_id)
    {
        if (empty($category_id)) {
            return false;
        }

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 compare_scores_by_custom_display is not named in camelCase.
Open

    public static function compare_scores_by_custom_display($score1, $score2)
    {
        if (!isset($score1)) {
            return isset($score2) ? 1 : 0;
        }

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 display_as_decimal is not named in camelCase.
Open

    private function display_as_decimal($score)
    {
        $score_denom = (0 == $score[1]) ? 1 : $score[1];

        return $this->format_score($score[0] / $score_denom);

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_number_decimals is not named in camelCase.
Open

    public function get_number_decimals()
    {
        $number_decimals = api_get_setting('gradebook_number_decimals');
        if (!isset($number_decimals)) {
            $number_decimals = 0;

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 is_custom is not named in camelCase.
Open

    public function is_custom()
    {
        return $this->custom_enabled;
    }

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 is_upperlimit_included is not named in camelCase.
Open

    public function is_upperlimit_included()
    {
        return $this->upperlimit_included;
    }

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_color_split_value is not named in camelCase.
Open

    public function get_color_split_value()
    {
        return $this->color_split_value;
    }

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 display_score is not named in camelCase.
Open

    public function display_score(
        $score,
        $type = SCORE_DIV_PERCENT,
        $what = SCORE_BOTH,
        $disableColor = false,

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 display_custom is not named in camelCase.
Open

    public function display_custom($score)
    {
        if (empty($score)) {
            return 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 display_as_div is not named in camelCase.
Open

    private function display_as_div($score, $ignoreDecimals = false, $removeEmptyDecimals = false)
    {
        if (1 == $score) {
            return '0 / 0';
        }

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_custom_displays is not named in camelCase.
Open

    private function get_custom_displays($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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 sort_display is not named in camelCase.
Open

    private function sort_display($item1, $item2)
    {
        if ($item1['score'] === $item2['score']) {
            return 0;
        } else {

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 display_as_percent is not named in camelCase.
Open

    private function display_as_percent($score)
    {
        if (empty($score)) {
            return 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 convert_displays is not named in camelCase.
Open

    private function convert_displays($custom_display)
    {
        if (isset($custom_display)) {
            // get highest score entry, and copy each element to a new array
            $converted = [];

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_score_color_percent is not named in camelCase.
Open

    private function get_score_color_percent($category_id = null)
    {
        $tbl_display = Database::get_main_table(TABLE_MAIN_GRADEBOOK_SCORE_DISPLAY);
        if (isset($category_id)) {
            $category_id = (int) $category_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

There are no issues that match your filters.

Category
Status