chamilo/chamilo-lms

View on GitHub
public/main/inc/lib/sub_language.class.php

Summary

Maintainability
A
0 mins
Test Coverage

Remove error control operator '@' on line 133.
Open

    public static function add_file_in_language_directory($system_path_file)
    {
        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

        return $return_value;

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

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

Remove error control operator '@' on line 185.
Open

    public static function addPoFileForSubLanguage($subLanguageIsoCode)
    {
        if (empty($subLanguageIsoCode)) {
            return false;
        }

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

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

Remove error control operator '@' on line 151.
Open

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

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

Avoid assigning values to variables in if clauses and the like (line '54', column '17').
Open

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

IfStatementAssignment

Since: 2.7.0

Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

Example

class Foo
{
    public function bar($flag)
    {
        if ($foo = 'bar') { // possible typo
            // ...
        }
        if ($baz = 0) { // always false
            // ...
        }
    }
}

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

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

            } else {
                return false;
            }

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

                        } else {
                            $content_dir[] = $file;
                        }

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

        } else {
            return false;
        }

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

        } else {
            return false;
        }

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

        } else {
            return false;
        }

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

            } else {
                $return_value = true;
            }

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

        } else {
            return false;
        }

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

        } else {
            $appendString = PHP_EOL . PHP_EOL . 'msgid "' . $msgid . '"' . PHP_EOL . 'msgstr "' . $content . '"';
            $fileContents .= $appendString;
        }

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

                } else {
                    $code = $pref;
                }

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function get_all_information_of_language($parent_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
        $rs = Database::query($sql);

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function add_file_in_language_directory($system_path_file)
    {
        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

        return $return_value;

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

    public static function check_if_language_is_father($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) AS count FROM '.$table.'
                WHERE parent_id= '.intval($language_id).' AND NOT ISNULL(parent_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 $new_variable is not named in camelCase.
Open

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function check_if_exist_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) as count
                FROM '.$table.'

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

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

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

    public static function get_name_of_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $language_id = intval($language_id);
        $sql = "SELECT original_name

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

    public static function check_if_language_is_sub_language($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) AS count FROM '.$table.'
                WHERE id = '.intval($language_id).' AND NOT ISNULL(parent_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 $get_as_string_index is not named in camelCase.
Open

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function check_if_language_is_used(int $language_id): bool
    {
        $language_info = self::get_all_information_of_language($language_id);
        $table = Database::get_main_table(TABLE_MAIN_USER);
        $sql = 'SELECT count(*) AS count FROM '.$table.'

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function make_unavailable_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='0'
                WHERE id = ".intval($language_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 $language_id is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 parameter $language_id is not named in camelCase.
Open

    public static function make_available_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='1'
                WHERE id = ".intval($language_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 $language_path is not named in camelCase.
Open

    public static function get_parent_language_path($language_path)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT dokeos_folder
                FROM ".$tbl_admin_languages."

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

Method name "SubLanguageManager::write_data_in_file" is not in camel caps format
Open

    public static function write_data_in_file($path_file, $new_term, $new_variable)

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

        $new_data = $new_variable.'='.$new_term;

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

        if (file_exists($path_file) && $resource) {

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

        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';

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

            if ($get_as_string_index) { //remove the prefix $

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

                WHERE id = '.intval($language_id).' AND NOT ISNULL(parent_id)';

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

    public static function add_file_in_language_directory($system_path_file)

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

    public static function check_if_exist_language_by_id($language_id)

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

        $all_information = [];

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

        $info_file = file($system_path_file);

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

        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

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

                $return_value = false;

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

                $return_value = true;

Method name "SubLanguageManager::check_if_exist_language_by_id" is not in camel caps format
Open

    public static function check_if_exist_language_by_id($language_id)

Method name "SubLanguageManager::get_name_of_language_by_id" is not in camel caps format
Open

    public static function get_name_of_language_by_id($language_id)

Method name "SubLanguageManager::check_if_language_is_sub_language" is not in camel caps format
Open

    public static function check_if_language_is_sub_language($language_id)

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

    public static function get_all_information_of_language($parent_id)

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

        $info_file = file($system_path_file);

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)

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

        $resource = @fopen($path_file, "a");

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

    public static function check_if_language_is_used(int $language_id): bool

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

            $all_information = $row;

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

        $res_list = [];

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

            return $res_list;

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

            $res_list[$var] = $val;

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

        return $return_value;

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

        $return_value = false;

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)

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

                WHERE id = $language_id";

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

        $content_dir = [];

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

        return $all_information;

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

        foreach ($info_file as $line) {

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

        $new_data = $new_variable.'='.$new_term;

Missing function doc comment
Open

    public function __construct()

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

                        if ($only_main_name) {

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

                                $content_dir[] = substr($file, 0, strpos($file, '.inc.php'));

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

        return $content_dir;

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

        return $res_list;

Missing blank line before return statement
Open

                return false;

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

        return $all_languages;

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

        $language_info = self::get_all_information_of_language($language_id);

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

            if (false === fwrite($resource, $new_data.PHP_EOL)) {

Missing blank line before return statement
Open

                return false;

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

        $language_id = intval($language_id);

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

                            $content_dir[] = $file;

Method name "SubLanguageManager::get_all_language_variable_in_file" is not in camel caps format
Open

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)

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

        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)

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

        $new_data = $new_variable.'='.$new_term;

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

        if (!is_readable($system_path_file)) {

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

        return $return_value;

Method name "SubLanguageManager::check_if_language_is_used" is not in camel caps format
Open

    public static function check_if_language_is_used(int $language_id): bool

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

        $language_id = intval($language_id);

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

    public static function check_if_language_is_sub_language($language_id)

Method name "SubLanguageManager::get_lang_folder_files_list" is not in camel caps format
Open

    public static function get_lang_folder_files_list($path, $only_main_name = false)

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

    public static function get_lang_folder_files_list($path, $only_main_name = false)

Method name "SubLanguageManager::add_file_in_language_directory" is not in camel caps format
Open

    public static function add_file_in_language_directory($system_path_file)

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

        $all_languages = [];

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

            $all_languages[$row['english_name']] = $row;

Method name "SubLanguageManager::get_all_information_of_language" is not in camel caps format
Open

    public static function get_all_information_of_language($parent_id)

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)

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

                WHERE id="'.intval($language_id).'"';

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

    public static function get_name_of_language_by_id($language_id)

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)

Method name "SubLanguageManager::make_unavailable_language" is not in camel caps format
Open

    public static function make_unavailable_language($language_id)

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

    public static function set_platform_language($language_id)

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

        if (empty($language_id) || (intval($language_id) != $language_id)) {

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

        $result_2 = Database::query($sql_update_2);

Missing blank line before return statement
Open

        return $parts[0].'.'.$languageCodeParts[0];

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

    public static function check_if_language_is_father($language_id)

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

    public static function make_unavailable_language($language_id)

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

        if (empty($language_id) || (intval($language_id) != $language_id)) {

Missing blank line before return statement
Open

        return substr($varName, 0, 25);  // Limit to 15 characters

Method name "SubLanguageManager::get_platform_language_id" is not in camel caps format
Open

    public static function get_platform_language_id()

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

        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);

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

                FROM ".$tbl_admin_languages."

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

                WHERE id = ".intval($language_id)."";

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

        $sql = "UPDATE $tbl_admin_languages SET available='1'

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

        if (empty($language_id) || (intval($language_id) != $language_id)) {

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

        $sql = "SELECT id FROM $tbl_admin_languages WHERE english_name ='$name'";

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

                WHERE locale ="'.Database::escape_string($language_info['english_name']).'" AND active <> '.USER_SOFT_DELETED;

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

                WHERE id = $language_id";

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

                    WHERE dokeos_folder = '".Database::escape_string($language_path)."'

Missing blank line before return statement
Open

        return api_get_path(SYS_PATH) . $path . $filename;

Declare public methods first,then protected ones and finally private ones
Open

    public static function updateOrAddMsgid($filename, $msgid, $content): array

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

        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);

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

    public static function make_available_language($language_id)

Expected 4 spaces after parameter name; 5 found
Open

     * @param string $msgid     Message identifier to search or add

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

        $sql = "UPDATE $tbl_admin_languages SET available='0'

Expected 1 spaces after parameter name; 2 found
Open

     * @param string $filename  Name of the .po file

Method name "SubLanguageManager::set_platform_language" is not in camel caps format
Open

    public static function set_platform_language($language_id)

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

        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);

Expected 2 spaces after parameter name; 3 found
Open

     * @param string $content   Associated message content

Add a comma after each item in a multi-line array
Open

        $messageInformation = [

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

        $sql = "SELECT * FROM $tbl_admin_languages

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

        $result_2 = Database::query($sql_update_2);

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

                    SELECT parent_id FROM ".$tbl_admin_languages."

Add a comma after each item in a multi-line array
Open

        $subLanguage = $languageRepository->findOneBy([

Method name "SubLanguageManager::check_if_language_is_father" is not in camel caps format
Open

    public static function check_if_language_is_father($language_id)

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

        $tbl_settings_current = Database::get_main_table(TABLE_MAIN_SETTINGS);

Add a comma after each item in a multi-line array
Open

            $entry = [

Blank line found at start of control structure
Open

            } catch (Exception $e) {

Declare public methods first,then protected ones and finally private ones
Open

    public static function checkIfLanguageExists(string $originalName, string $englishName, string $isoCode): array

Method name "SubLanguageManager::make_available_language" is not in camel caps format
Open

    public static function make_available_language($language_id)

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

        return false !== $result_2;

Method name "SubLanguageManager::get_parent_language_path" is not in camel caps format
Open

    public static function get_parent_language_path($language_path)

Expected 1 spaces after parameter name; 2 found
Open

     * @param int    $languageId  The ID of the language to search in.

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

                WHERE parent_id= '.intval($language_id).' AND NOT ISNULL(parent_id);';

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

        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);

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

                WHERE id = ".intval($language_id)."";

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

        $language_id = intval($language_id);

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

        $sql_update_2 = "UPDATE $tbl_settings_current SET selected_value = '".$lang['isocode']."'

Expected 7 spaces after parameter name; 8 found
Open

     * @param string $term        The term to search for.

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

        $language_id = intval($language_id);

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

        $sql_update_2 = "UPDATE $tbl_settings_current SET selected_value = '".$lang['isocode']."'

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

        $language_info = self::get_all_information_of_language($language_id);

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

        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);

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

    public static function get_parent_language_path($language_path)

Missing function doc comment
Open

    public static function generateSublanguageCode(string $parentCode, string $variant, int $maxLength = 10): string

The variable $all_languages is not named in camelCase.
Open

    public static function getAllLanguages($onlyActive = false)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table;
        if ($onlyActive) {

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

    public static function getAllLanguages($onlyActive = false)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table;
        if ($onlyActive) {

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function check_if_language_is_used(int $language_id): bool
    {
        $language_info = self::get_all_information_of_language($language_id);
        $table = Database::get_main_table(TABLE_MAIN_USER);
        $sql = 'SELECT count(*) AS count FROM '.$table.'

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

    public static function get_all_information_of_language($parent_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
        $rs = Database::query($sql);

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

    public static function check_if_language_is_sub_language($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) AS count FROM '.$table.'
                WHERE id = '.intval($language_id).' AND NOT ISNULL(parent_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 $language_id is not named in camelCase.
Open

    public static function check_if_language_is_father($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) AS count FROM '.$table.'
                WHERE parent_id= '.intval($language_id).' AND NOT ISNULL(parent_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 $content_dir is not named in camelCase.
Open

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function check_if_language_is_used(int $language_id): bool
    {
        $language_info = self::get_all_information_of_language($language_id);
        $table = Database::get_main_table(TABLE_MAIN_USER);
        $sql = 'SELECT count(*) AS count FROM '.$table.'

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

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function add_file_in_language_directory($system_path_file)
    {
        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

        return $return_value;

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

    public static function get_name_of_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $language_id = intval($language_id);
        $sql = "SELECT original_name

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function add_file_in_language_directory($system_path_file)
    {
        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

        return $return_value;

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

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

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

    public static function get_all_information_of_language($parent_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
        $rs = Database::query($sql);

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function check_if_language_is_used(int $language_id): bool
    {
        $language_info = self::get_all_information_of_language($language_id);
        $table = Database::get_main_table(TABLE_MAIN_USER);
        $sql = 'SELECT count(*) AS count FROM '.$table.'

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

    public static function getAllLanguages($onlyActive = false)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table;
        if ($onlyActive) {

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

    public static function get_all_information_of_language($parent_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
        $rs = Database::query($sql);

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

    public static function get_all_information_of_language($parent_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
        $rs = Database::query($sql);

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function add_file_in_language_directory($system_path_file)
    {
        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

        return $return_value;

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function check_if_exist_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) as count
                FROM '.$table.'

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

    public static function get_name_of_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $language_id = intval($language_id);
        $sql = "SELECT original_name

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

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function get_name_of_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $language_id = intval($language_id);
        $sql = "SELECT original_name

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

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_admin_languages is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_settings_current is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $language_id is not named in camelCase.
Open

    public static function make_unavailable_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='0'
                WHERE id = ".intval($language_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 $language_id is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_admin_languages is not named in camelCase.
Open

    public static function get_parent_language_path($language_path)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT dokeos_folder
                FROM ".$tbl_admin_languages."

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

    public static function make_available_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='1'
                WHERE id = ".intval($language_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 $language_id is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $language_id is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_admin_languages is not named in camelCase.
Open

    public static function make_unavailable_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='0'
                WHERE id = ".intval($language_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_admin_languages is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_admin_languages is not named in camelCase.
Open

    public static function get_parent_language_path($language_path)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT dokeos_folder
                FROM ".$tbl_admin_languages."

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

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_admin_languages is not named in camelCase.
Open

    public static function get_platform_language_id()
    {
        $name = api_get_setting('platformLanguage');
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT id FROM $tbl_admin_languages WHERE english_name ='$name'";

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

    public static function get_parent_language_path($language_path)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT dokeos_folder
                FROM ".$tbl_admin_languages."

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

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_settings_current is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $result_2 is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $language_id is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $sql_update_2 is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_admin_languages is not named in camelCase.
Open

    public static function make_unavailable_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='0'
                WHERE id = ".intval($language_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_admin_languages is not named in camelCase.
Open

    public static function make_available_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='1'
                WHERE id = ".intval($language_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_admin_languages is not named in camelCase.
Open

    public static function make_available_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='1'
                WHERE id = ".intval($language_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_update_2 is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 $tbl_admin_languages is not named in camelCase.
Open

    public static function get_platform_language_id()
    {
        $name = api_get_setting('platformLanguage');
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT id FROM $tbl_admin_languages WHERE english_name ='$name'";

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

    public static function get_parent_language_path($language_path)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT dokeos_folder
                FROM ".$tbl_admin_languages."

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

    public static function add_file_in_language_directory($system_path_file)
    {
        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);

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

    public static function write_data_in_file($path_file, $new_term, $new_variable)
    {
        $return_value = false;
        $new_data = $new_variable.'='.$new_term;
        $resource = @fopen($path_file, "a");

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

    public static function check_if_language_is_father($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) AS count FROM '.$table.'
                WHERE parent_id= '.intval($language_id).' AND NOT ISNULL(parent_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_all_information_of_language is not named in camelCase.
Open

    public static function get_all_information_of_language($parent_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
        $rs = Database::query($sql);

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

    public static function check_if_exist_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) as count
                FROM '.$table.'

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

    public static function check_if_language_is_sub_language($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = 'SELECT count(*) AS count FROM '.$table.'
                WHERE id = '.intval($language_id).' AND NOT ISNULL(parent_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_name_of_language_by_id is not named in camelCase.
Open

    public static function get_name_of_language_by_id($language_id)
    {
        $table = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $language_id = intval($language_id);
        $sql = "SELECT original_name

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

    public static function get_lang_folder_files_list($path, $only_main_name = false)
    {
        $content_dir = [];
        if (is_dir($path)) {
            if ($dh = opendir($path)) {

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

    public static function check_if_language_is_used(int $language_id): bool
    {
        $language_info = self::get_all_information_of_language($language_id);
        $table = Database::get_main_table(TABLE_MAIN_USER);
        $sql = 'SELECT count(*) AS count FROM '.$table.'

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

    public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
    {
        $res_list = [];
        if (!is_readable($system_path_file)) {
            return $res_list;

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

    public static function make_unavailable_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='0'
                WHERE id = ".intval($language_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_platform_language is not named in camelCase.
Open

    public static function set_platform_language($language_id)
    {
        if (empty($language_id) || (intval($language_id) != $language_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 get_platform_language_id is not named in camelCase.
Open

    public static function get_platform_language_id()
    {
        $name = api_get_setting('platformLanguage');
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT id FROM $tbl_admin_languages WHERE english_name ='$name'";

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

    public static function get_parent_language_path($language_path)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "SELECT dokeos_folder
                FROM ".$tbl_admin_languages."

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

    public static function make_available_language($language_id)
    {
        $tbl_admin_languages = Database::get_main_table(TABLE_MAIN_LANGUAGE);
        $sql = "UPDATE $tbl_admin_languages SET available='1'
                WHERE id = ".intval($language_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