chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

The function api_format_date() has an NPath complexity of 416. The configured NPath complexity threshold is 200.
Open

function api_format_date($time, $format = null, $language = null)
{
    if (empty($time)) {
        return '';
    }

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 function api_get_local_time() has an NPath complexity of 400. The configured NPath complexity threshold is 200.
Open

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 '246', column '24').
Open

            return new DateTime(gmdate('Y-m-d H:i:s'), new DateTimeZone('UTC'));

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 '533', column '25').
Open

        $language = new Westsworld\TimeAgo\Translations\En();

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 '492', column '27').
Open

    $date_formatter = new IntlDateFormatter($language, $datetype, $timetype, date_default_timezone_get());

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 '545', column '20').
Open

        $now = new DateTime('now', $date->getTimezone());

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 '264', column '21').
Open

        $date = new DateTime($time, new DateTimezone($fromTimezone));

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 '257', column '44').
Open

            return new DateTime($time, new DateTimeZone('UTC'));

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 '265', column '32').
Open

        $date->setTimezone(new DateTimeZone('UTC'));

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 '339', column '21').
Open

        $date = new DateTime($time, new DateTimezone($from_timezone));

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 '257', column '24').
Open

            return new DateTime($time, new DateTimeZone('UTC'));

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 '339', column '41').
Open

        $date = new DateTime($time, new DateTimezone($from_timezone));

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 '213', column '34').
Open

            $newExtraField = new ExtraFieldValue('user');

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 '264', column '41').
Open

        $date = new DateTime($time, new DateTimezone($fromTimezone));

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 '340', column '32').
Open

        $date->setTimezone(new DateTimeZone($to_timezone));

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 '246', column '60').
Open

            return new DateTime(gmdate('Y-m-d H:i:s'), new DateTimeZone('UTC'));

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

        } else {
            return $date->format('Y-m-d H:i:s');
        }

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

        } else {
            return $date->format('Y-m-d H:i:s');
        }

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

    } else {
        if ($humanForm) {
            return $date->format('j M Y');
        } else {
            return $date->format('Y-m-d');

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

    } else {
        $language = new Westsworld\TimeAgo\Translations\En();
    }

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

        } else {
            return $date->format('Y-m-d');
        }

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

        } else {
            $valid[$format][$language] = _api_validate_person_name_format($format);
        }

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 '$encoding'.
Open

function api_substr_replace($string, $replacement, $start, $length = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$language'.
Open

function api_strcmp($string1, $string2, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strnatcmp($string1, $string2, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$timeZone'.
Open

function date_to_str_ago($date, $timeZone = 'UTC', $returnDateDifference = false)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_str_split($string, $split_length = 1, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strtolower($string, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strtoupper(?string $string, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$check_utf8_validity'.
Open

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_stripos($haystack, $needle, $offset = 0, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strripos($haystack, $needle, $offset = 0, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strrpos($haystack, $needle, $offset = 0, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$language'.
Open

function api_natsort(&$array, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_natsort(&$array, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_natrsort(&$array, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_stristr($haystack, $needle, $before_needle = false, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strlen($string, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$language'.
Open

function api_strnatcmp($string1, $string2, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strpos($haystack, $needle, $offset = 0, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

    $encoding = null

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_ucfirst($string, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strstr($haystack, $needle, $before_needle = false, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strcmp($string1, $string2, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_ucwords($string, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_preg_replace($pattern, $replacement, $subject, $limit = -1, $count = 0, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$before_needle'.
Open

function api_strrchr($haystack, $needle, $before_needle = false, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$language'.
Open

function api_natrsort(&$array, $language = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$unknown'.
Open

function api_transliterate($string, $unknown = '?', $from_encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$from_encoding'.
Open

function api_transliterate($string, $unknown = '?', $from_encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_str_ireplace($search, $replace, $subject, &$count = null, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_strrchr($haystack, $needle, $before_needle = false, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

Avoid unused parameters such as '$encoding'.
Open

function api_substr_count($haystack, $needle, $encoding = null)

UnusedFormalParameter

Since: 0.2

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

Example

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

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

The parameter $before_needle is not named in camelCase.
Open

function api_strrchr($haystack, $needle, $before_needle = false, $encoding = null)
{
    return strrchr($haystack, $needle);
}

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

function api_str_split($string, $split_length = 1, $encoding = null)
{
    return str_split($string, $split_length);
}

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

function api_convert_and_format_date($time = null, $format = null, $from_timezone = null)
{
    // First, convert the datetime to the right timezone
    $time = api_get_local_time($time, null, $from_timezone, true);

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

function api_transliterate($string, $unknown = '?', $from_encoding = null)
{
    return URLify::transliterate($string);
}

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

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)
{
    $system_encoding = api_get_system_encoding();

    return api_convert_encoding($string, $system_encoding, $from_encoding);

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

function api_strstr($haystack, $needle, $before_needle = false, $encoding = null)
{
    return strstr($haystack, $needle, $before_needle);
}

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

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')
{
    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {
        return $string;
    }

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

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')
{
    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {
        return $string;
    }

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

function api_htmlentities($string, $quote_style = ENT_COMPAT)
{
    switch ($quote_style) {
        case ENT_COMPAT:
            $string = str_replace(['&', '"', '<', '>'], ['&amp;', '&quot;', '&lt;', '&gt;'], $string);

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

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $first_name is not named in camelCase.
Open

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = null,

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $from_encoding is not named in camelCase.
Open

function api_utf8_encode($string, $from_encoding = 'UTF-8')
{
    return mb_convert_encoding($string, 'UTF-8', $from_encoding);
}

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

function api_xml_http_response_encode($string, $from_encoding = 'UTF8')
{
    if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 'xmlhttprequest' == strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])) {
        if (empty($from_encoding)) {
            $from_encoding = _api_mb_internal_encoding();

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

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = null,

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The parameter $before_needle is not named in camelCase.
Open

function api_stristr($haystack, $needle, $before_needle = false, $encoding = null)
{
    return stristr($haystack, $needle, $before_needle);
}

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

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $check_utf8_validity is not named in camelCase.
Open

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)
{
    $system_encoding = api_get_system_encoding();

    return api_convert_encoding($string, $system_encoding, $from_encoding);

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

function _api_clean_person_name($person_name)
{
    return preg_replace(['/\s+/', '/, ,/', '/,+/', '/^[ ,]/', '/[ ,]$/'], [' ', ', ', ',', '', ''], $person_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

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

    $from_timezone = null,

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

        $from_timezone = 'UTC';

Consider putting global function "api_get_months_short" in a static class
Open

function api_get_months_short($language = null)

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

        $first_name,

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

    $null_option = ['' => ''];

Consider putting global function "api_get_timezone" in a static class
Open

function api_get_timezone()

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

    $to_timezone = null,

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

    $system_encoding = api_get_system_encoding();

Consider putting global function "api_get_utc_datetime" in a static class
Open

function api_get_utc_datetime($time = null, $returnNullIfInvalidDate = false, $returnObj = false)

Consider putting global function "api_strtotime" in a static class
Open

function api_strtotime($time, $timezone = null)

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

    return $formatted_date;

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

        $last_name,

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

    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {

Consider putting global function "api_to_system_encoding" in a static class
Open

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)

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

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)

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

            $to_timezone = api_get_timezone();

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

    $system_timezone = date_default_timezone_get();

Consider putting global function "api_is_western_name_order" in a static class
Open

function api_is_western_name_order($format = null, $language = null)

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

    sort($timezone_identifiers);

Consider putting global function "api_get_local_time" in a static class
Open

function api_get_local_time(

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

        $from_timezone = 'UTC';

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

        date_default_timezone_set($system_timezone);

Consider putting global function "date_to_str_ago" in a static class
Open

function date_to_str_ago($date, $timeZone = 'UTC', $returnDateDifference = false)

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

    $last_name,

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

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)

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

    return array_merge($null_option, $out);

Expected 59 spaces after parameter type; 1 found
Open

 * @param mixed $time Timestamp or datetime string

Expected 5 spaces after parameter name; 1 found
Open

 * @param mixed $time Timestamp or datetime string

Missing parameter name
Open

 * @param string|int Date format (see date formats in the Chamilo system:

Expected 58 spaces after parameter type; 1 found
Open

 * @param string $language (optional) Language id

Consider putting global function "api_format_date" in a static class
Open

function api_format_date($time, $format = null, $language = null)

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

        api_strtoupper($first_name),

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

        $test_name = api_get_person_name('%f', '%l', '%t', $format, $language);

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

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')

Consider putting global function "api_utf8_encode" in a static class
Open

function api_utf8_encode($string, $from_encoding = 'UTF-8')

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

    $timezone_identifiers = DateTimeZone::listIdentifiers();

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

    $date_formatter = new IntlDateFormatter($language, $datetype, $timetype, date_default_timezone_get());

Missing parameter name
Open

 * @param string Timezone to be converted from. If null, UTC will be assumed.

Consider putting global function "api_convert_and_format_date" in a static class
Open

function api_convert_and_format_date($time = null, $format = null, $from_timezone = null)

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

    $time = api_get_local_time($time, null, $from_timezone, true);

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

        $order[$format][$language] = stripos($test_name, '%f') <= stripos($test_name, '%l');

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

    return mb_convert_encoding($string, 'UTF-8', $from_encoding);

Consider putting global function "get_lang" in a static class
Open

function get_lang(string $variable, ?string $locale = null): string

Missing parameter name
Open

 * @param mixed Format to be used (TIME_NO_SEC_FORMAT, DATE_FORMAT_SHORT, DATE_FORMAT_LONG, DATE_TIME_FORMAT_LONG)

Consider putting global function "api_get_person_name" in a static class
Open

function api_get_person_name(

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

        api_strtoupper($last_name),

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

    $person_name = str_replace($keywords, $values, $format);

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

    return _api_clean_person_name($person_name);

Consider putting global function "api_utf8_decode" in a static class
Open

function api_utf8_decode($string, $toEncoding = null)

Consider putting global function "api_get_language_isocode" in a static class
Open

function api_get_language_isocode()

Consider putting global function "api_get_text_direction" in a static class
Open

function api_get_text_direction($iso = '')

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

        $from_timezone = 'UTC';

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

        $last_name,

Consider putting global function "api_get_platform_isocodes" in a static class
Open

function api_get_platform_isocodes()

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

        if (is_null($to_timezone)) {

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

    $formatted_date = api_to_system_encoding($date_formatter->format($time), 'UTF-8');

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

function api_convert_and_format_date($time = null, $format = null, $from_timezone = null)

Consider putting global function "api_convert_encoding" in a static class
Open

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')

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

    return mb_convert_encoding($string, $to_encoding, $from_encoding);

Consider putting global function "api_get_timezones" in a static class
Open

function api_get_timezones()

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

        $date->setTimezone(new DateTimeZone($to_timezone));

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

        $order[$format][$language] = stripos($test_name, '%f') <= stripos($test_name, '%l');

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

    if (!isset($sort_by_first_name[$language])) {

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

        $date = new DateTime($time, new DateTimezone($from_timezone));

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

    $formatted_date = api_to_system_encoding($date_formatter->format($time), 'UTF-8');

Consider putting global function "api_get_months_long" in a static class
Open

function api_get_months_long($language = null)

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

    $first_name,

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

    return mb_convert_encoding($string, $to_encoding, $from_encoding);

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

function api_utf8_encode($string, $from_encoding = 'UTF-8')

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

    $system_timezone = date_default_timezone_get();

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

    return $sort_by_first_name[$language];

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

    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {

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

    if (is_null($from_timezone)) {

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

    date_default_timezone_set($system_timezone);

Missing parameter name
Open

 * @param mixed The time to be converted

Consider putting global function "api_get_week_days_long" in a static class
Open

function api_get_week_days_long($language = null)

Consider putting global function "api_sort_by_first_name" in a static class
Open

function api_sort_by_first_name($language = null)

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

    static $sort_by_first_name = [];

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

        $sort_by_first_name[$language] = _api_get_person_name_convention($language, 'sort_by');

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

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')

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

    foreach ($timezone_identifiers as $tz) {

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

        $from_timezone = 'UTC';

Consider putting global function "api_get_week_days_short" in a static class
Open

function api_get_week_days_short($language = null)

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

        $first_name,

Consider putting global function "api_strpos" in a static class
Open

function api_strpos($haystack, $needle, $offset = 0, $encoding = null)

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

    return strstr($haystack, $needle, $before_needle);

Consider putting global function "get_plugin_lang" in a static class
Open

function get_plugin_lang($variable, $pluginName)

Consider putting global function "_api_validate_person_name_format" in a static class
Open

function _api_validate_person_name_format($format)

Doc comment for parameter $quote_style does not match actual variable name $quoteStyle
Open

 * @param int    $quote_style (optional)    The quote style - ENT_COMPAT (default), ENT_QUOTES, ENT_NOQUOTES

Consider putting global function "api_strrchr" in a static class
Open

function api_strrchr($haystack, $needle, $before_needle = false, $encoding = null)

Consider putting global function "api_is_valid_utf8" in a static class
Open

function api_is_valid_utf8($string)

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

    switch ($quote_style) {

Consider putting global function "api_refine_encoding_id" in a static class
Open

function api_refine_encoding_id($encoding)

Consider putting global function "api_detect_encoding" in a static class
Open

function api_detect_encoding($string)

Consider putting global function "api_is_valid_ascii" in a static class
Open

function api_is_valid_ascii(&$string)

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

                $week_day[$i].'Long',

Consider putting global function "_api_strnatrcmp" in a static class
Open

function _api_strnatrcmp($string1, $string2)

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

    return api_convert_encoding($string, $system_encoding, $from_encoding);

Consider putting global function "api_html_entity_decode" in a static class
Open

function api_html_entity_decode($string, $quoteStyle = ENT_COMPAT, $encoding = 'UTF-8')

Consider putting global function "api_str_ireplace" in a static class
Open

function api_str_ireplace($search, $replace, $subject, &$count = null, $encoding = null)

Consider putting global function "api_natrsort" in a static class
Open

function api_natrsort(&$array, $language = null, $encoding = null)

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

    return str_split($string, $split_length);

Consider putting global function "api_strlen" in a static class
Open

function api_strlen($string, $encoding = null)

Consider putting global function "api_strrpos" in a static class
Open

function api_strrpos($haystack, $needle, $offset = 0, $encoding = null)

Doc comment for parameter &$matches does not match actual variable name $matches
Open

 * @param array  &$matches (optional)    Array of all matches in multi-dimensional array ordered according to $flags

Consider putting global function "api_preg_split" in a static class
Open

function api_preg_split($pattern, $subject, $limit = -1, $flags = 0)

Consider putting global function "api_strnatcmp" in a static class
Open

function api_strnatcmp($string1, $string2, $language = null, $encoding = null)

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

function _api_clean_person_name($person_name)

Consider putting global function "api_xml_http_response_encode" in a static class
Open

function api_xml_http_response_encode($string, $from_encoding = 'UTF8')

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

            $from_encoding = _api_mb_internal_encoding();

Consider putting global function "api_transliterate" in a static class
Open

function api_transliterate($string, $unknown = '?', $from_encoding = null)

Consider putting global function "api_strtoupper" in a static class
Open

function api_strtoupper(?string $string, $encoding = null)

Consider putting global function "api_preg_match" in a static class
Open

function api_preg_match(

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

                $week_day[$i].'Short',

Consider putting global function "_api_clean_person_name" in a static class
Open

function _api_clean_person_name($person_name)

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

function api_str_split($string, $split_length = 1, $encoding = null)

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

    return stristr($haystack, $needle, $before_needle);

Consider putting global function "api_get_system_encoding" in a static class
Open

function api_get_system_encoding()

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

            $date_parts[$language]['days_long'][] = get_lang(

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

    return preg_replace(['/\s+/', '/, ,/', '/,+/', '/^[ ,]/', '/[ ,]$/'], [' ', ', ', ',', '', ''], $person_name);

Consider putting global function "_api_mb_internal_encoding" in a static class
Open

function _api_mb_internal_encoding($encoding = 'UTF-8')

Consider putting global function "api_str_split" in a static class
Open

function api_str_split($string, $split_length = 1, $encoding = null)

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

    if (!isset($date_parts[$language])) {

Consider putting global function "api_strtolower" in a static class
Open

function api_strtolower($string, $encoding = null)

Consider putting global function "api_preg_match_all" in a static class
Open

function api_preg_match_all($pattern, $subject, &$matches, $flags = PREG_PATTERN_ORDER, $offset = 0, $encoding = null)

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

    static $date_parts = [];

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

            $date_parts[$language]['days_short'][] = get_lang(

Consider putting global function "api_htmlentities" in a static class
Open

function api_htmlentities($string, $quote_style = ENT_COMPAT)

Consider putting global function "api_natsort" in a static class
Open

function api_natsort(&$array, $language = null, $encoding = null)

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

            $date_parts[$language]['months_short'][] = get_lang(

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

        if (empty($from_encoding)) {

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

function api_transliterate($string, $unknown = '?', $from_encoding = null)

Consider putting global function "api_stristr" in a static class
Open

function api_stristr($haystack, $needle, $before_needle = false, $encoding = null)

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

function api_stristr($haystack, $needle, $before_needle = false, $encoding = null)

Consider putting global function "api_ucwords" in a static class
Open

function api_ucwords($string, $encoding = null)

Consider putting global function "api_preg_replace" in a static class
Open

function api_preg_replace($pattern, $replacement, $subject, $limit = -1, $count = 0, $encoding = null)

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

    return api_convert_encoding($string, $system_encoding, $from_encoding);

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

function api_xml_http_response_encode($string, $from_encoding = 'UTF8')

Consider putting global function "api_strripos" in a static class
Open

function api_strripos($haystack, $needle, $offset = 0, $encoding = null)

Doc comment for parameter &$matches does not match actual variable name $matches
Open

 * @param array  &$matches (optional) If matches is provided,

Consider putting global function "api_strcasecmp" in a static class
Open

function api_strcasecmp($string1, $string2, $language = null, $encoding = null)

Consider putting global function "api_strcmp" in a static class
Open

function api_strcmp($string1, $string2, $language = null, $encoding = null)

Consider putting global function "api_is_valid_date" in a static class
Open

function api_is_valid_date($date, $format = 'Y-m-d H:i:s')

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

            $date_parts[$language]['months_long'][] = get_lang(

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

    return $date_parts[$language];

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

function api_strstr($haystack, $needle, $before_needle = false, $encoding = null)

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

function api_strrchr($haystack, $needle, $before_needle = false, $encoding = null)

Consider putting global function "api_substr" in a static class
Open

function api_substr($string, $start, $length = null, $encoding = null)

Consider putting global function "api_substr_replace" in a static class
Open

function api_substr_replace($string, $replacement, $start, $length = null, $encoding = null)

Consider putting global function "api_ucfirst" in a static class
Open

function api_ucfirst($string, $encoding = null)

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

        $week_day = [

Consider putting global function "api_get_human_date_time" in a static class
Open

function api_get_human_date_time($date, $showTime = true, $humanForm = false)

Consider putting global function "api_ord" in a static class
Open

function api_ord($character, $encoding = 'UTF-8')

Consider putting global function "api_stripos" in a static class
Open

function api_stripos($haystack, $needle, $offset = 0, $encoding = null)

Consider putting global function "api_substr_count" in a static class
Open

function api_substr_count($haystack, $needle, $encoding = null)

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

function api_htmlentities($string, $quote_style = ENT_COMPAT)

Consider putting global function "api_strstr" in a static class
Open

function api_strstr($haystack, $needle, $before_needle = false, $encoding = null)

Doc comment for parameter &$count does not match actual variable name $count
Open

 * @param int          &$count      If specified, this variable will be filled with the number of replacements done

Superfluous parameter comment
Open

 * @param string $encoding (optional)    The used internally by this function character encoding. If it is omitted, the

Consider putting global function "_api_get_day_month_names" in a static class
Open

function &_api_get_day_month_names($language = null)

Consider putting global function "_api_get_person_name_convention" in a static class
Open

function _api_get_person_name_convention($iso, $type)

The variable $test_name is not named in camelCase.
Open

function api_is_western_name_order($format = null, $language = null)
{
    static $order = [];
    if (empty($format)) {
        $format = PERSON_NAME_COMMON_CONVENTION;

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

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')
{
    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {
        return $string;
    }

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

function api_xml_http_response_encode($string, $from_encoding = 'UTF8')
{
    if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 'xmlhttprequest' == strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])) {
        if (empty($from_encoding)) {
            $from_encoding = _api_mb_internal_encoding();

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

function api_get_timezones()
{
    $timezone_identifiers = DateTimeZone::listIdentifiers();
    sort($timezone_identifiers);
    $out = [];

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

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $from_timezone is not named in camelCase.
Open

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $to_timezone is not named in camelCase.
Open

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $to_encoding is not named in camelCase.
Open

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')
{
    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {
        return $string;
    }

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

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')
{
    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {
        return $string;
    }

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

function api_strtotime($time, $timezone = null)
{
    $system_timezone = date_default_timezone_get();
    if (!empty($timezone)) {
        date_default_timezone_set($timezone);

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

function api_format_date($time, $format = null, $language = null)
{
    if (empty($time)) {
        return '';
    }

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

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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 $system_encoding is not named in camelCase.
Open

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)
{
    $system_encoding = api_get_system_encoding();

    return api_convert_encoding($string, $system_encoding, $from_encoding);

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

function api_xml_http_response_encode($string, $from_encoding = 'UTF8')
{
    if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 'xmlhttprequest' == strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])) {
        if (empty($from_encoding)) {
            $from_encoding = _api_mb_internal_encoding();

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

function api_get_timezones()
{
    $timezone_identifiers = DateTimeZone::listIdentifiers();
    sort($timezone_identifiers);
    $out = [];

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

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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 $from_timezone is not named in camelCase.
Open

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $to_timezone is not named in camelCase.
Open

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $system_timezone is not named in camelCase.
Open

function api_strtotime($time, $timezone = null)
{
    $system_timezone = date_default_timezone_get();
    if (!empty($timezone)) {
        date_default_timezone_set($timezone);

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

function api_sort_by_first_name($language = null)
{
    static $sort_by_first_name = [];

    if (empty($language)) {

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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 $last_name is not named in camelCase.
Open

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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 $system_encoding is not named in camelCase.
Open

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)
{
    $system_encoding = api_get_system_encoding();

    return api_convert_encoding($string, $system_encoding, $from_encoding);

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function api_format_date($time, $format = null, $language = null)
{
    if (empty($time)) {
        return '';
    }

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

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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 $test_name is not named in camelCase.
Open

function api_is_western_name_order($format = null, $language = null)
{
    static $order = [];
    if (empty($format)) {
        $format = PERSON_NAME_COMMON_CONVENTION;

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

function api_stristr($haystack, $needle, $before_needle = false, $encoding = null)
{
    return stristr($haystack, $needle, $before_needle);
}

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

function api_strstr($haystack, $needle, $before_needle = false, $encoding = null)
{
    return strstr($haystack, $needle, $before_needle);
}

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function api_str_split($string, $split_length = 1, $encoding = null)
{
    return str_split($string, $split_length);
}

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function api_format_date($time, $format = null, $language = null)
{
    if (empty($time)) {
        return '';
    }

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

function api_sort_by_first_name($language = null)
{
    static $sort_by_first_name = [];

    if (empty($language)) {

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

function api_convert_encoding($string, $to_encoding, $from_encoding = 'UTF-8')
{
    if (strtoupper($to_encoding) === strtoupper($from_encoding)) {
        return $string;
    }

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

function api_to_system_encoding($string, $from_encoding = null, $check_utf8_validity = false)
{
    $system_encoding = api_get_system_encoding();

    return api_convert_encoding($string, $system_encoding, $from_encoding);

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $formatted_date is not named in camelCase.
Open

function api_format_date($time, $format = null, $language = null)
{
    if (empty($time)) {
        return '';
    }

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

function api_is_western_name_order($format = null, $language = null)
{
    static $order = [];
    if (empty($format)) {
        $format = PERSON_NAME_COMMON_CONVENTION;

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function _api_clean_person_name($person_name)
{
    return preg_replace(['/\s+/', '/, ,/', '/,+/', '/^[ ,]/', '/[ ,]$/'], [' ', ', ', ',', '', ''], $person_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 $from_timezone is not named in camelCase.
Open

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $system_timezone is not named in camelCase.
Open

function api_format_date($time, $format = null, $language = null)
{
    if (empty($time)) {
        return '';
    }

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

function api_convert_and_format_date($time = null, $format = null, $from_timezone = null)
{
    // First, convert the datetime to the right timezone
    $time = api_get_local_time($time, null, $from_timezone, true);

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $last_name is not named in camelCase.
Open

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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 $person_name is not named in camelCase.
Open

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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 $sort_by_first_name is not named in camelCase.
Open

function api_sort_by_first_name($language = null)
{
    static $sort_by_first_name = [];

    if (empty($language)) {

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

function api_utf8_encode($string, $from_encoding = 'UTF-8')
{
    return mb_convert_encoding($string, 'UTF-8', $from_encoding);
}

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function api_get_timezones()
{
    $timezone_identifiers = DateTimeZone::listIdentifiers();
    sort($timezone_identifiers);
    $out = [];

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

function &_api_get_day_month_names($language = null)
{
    static $date_parts = [];
    if (empty($language)) {
        $language = api_get_language_isocode();

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

function api_get_timezones()
{
    $timezone_identifiers = DateTimeZone::listIdentifiers();
    sort($timezone_identifiers);
    $out = [];

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

function api_format_date($time, $format = null, $language = null)
{
    if (empty($time)) {
        return '';
    }

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

function api_htmlentities($string, $quote_style = ENT_COMPAT)
{
    switch ($quote_style) {
        case ENT_COMPAT:
            $string = str_replace(['&', '"', '<', '>'], ['&amp;', '&quot;', '&lt;', '&gt;'], $string);

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

function api_get_timezones()
{
    $timezone_identifiers = DateTimeZone::listIdentifiers();
    sort($timezone_identifiers);
    $out = [];

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

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $to_timezone is not named in camelCase.
Open

function api_get_local_time(
    $time = null,
    $to_timezone = null,
    $from_timezone = null,
    $returnNullIfInvalidDate = 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 $first_name is not named in camelCase.
Open

function api_get_person_name(
    $first_name,
    $last_name,
    $title = null,
    $format = 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

There are no issues that match your filters.

Category
Status