chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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 54.
Open

function api_detect_encoding_html($string)
{
    if (@preg_match('/<head.*(<meta[^>]*content=[^>]*>).*<\/head>/si', $string, $matches)) {
        if (@preg_match('/<meta[^>]*charset=(.*)["\';][^>]*>/si', $matches[1], $matches)) {
            return api_refine_encoding_id(trim($matches[1]));
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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 73.
Open

function api_set_encoding_html(&$string, $encoding)
{
    $old_encoding = api_detect_encoding_html($string);
    if (@preg_match('/(.*<head.*)(<meta[^>]*content=[^>]*>)(.*<\/head>.*)/si', $string, $matches)) {
        $meta = $matches[2];
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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 71.
Open

function api_set_encoding_html(&$string, $encoding)
{
    $old_encoding = api_detect_encoding_html($string);
    if (@preg_match('/(.*<head.*)(<meta[^>]*content=[^>]*>)(.*<\/head>.*)/si', $string, $matches)) {
        $meta = $matches[2];
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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 53.
Open

function api_detect_encoding_html($string)
{
    if (@preg_match('/<head.*(<meta[^>]*content=[^>]*>).*<\/head>/si', $string, $matches)) {
        if (@preg_match('/<meta[^>]*charset=(.*)["\';][^>]*>/si', $matches[1], $matches)) {
            return api_refine_encoding_id(trim($matches[1]));
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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 121.
Open

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

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

    } else {
        $count = 1;
        if (false !== strpos('</head>', strtolower($string))) {
            $string = str_ireplace(
                '</head>',
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

            } else {
                $output = $output." ".$words[$i];
                $i++;
            }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

    } else {
        $file_size = $file_size.'B';
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

        } else {
            $replace = str_replace('?>', ' encoding="'.$to_encoding.'"?>', $matches[0]);
        }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

            } else {
                $result = number_format(
                    round($number, 2),
                    (0 == $flag ? 0 : EXERCISE_NUMBER_OF_DECIMALS),
                    $decimalPoint,
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

        } else {
            $string = str_ireplace(
                '<body>',
                '<head><meta http-equiv="Content-Type" content="text/html; charset='.$encoding.'"/></head><body>',
                $string,
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

    } else {
        $suffix = $matches[3];
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

        } else {
            if (floor($number) == $number) {
                $result = number_format(
                    $number,
                    (2 == $flag ? EXERCISE_NUMBER_OF_DECIMALS : 0),
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

    } else {
        $output = $text;

        return $output;
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

        } else {
            $string = $matches[1].'<meta http-equiv="Content-Type" content="text/html; charset='.$encoding.'"/>'.$matches[3];
        }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function esc_url($url, $protocols = null, $_context = 'display')
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function esc_url($url, $protocols = null, $_context = 'display')
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function _api_convert_encoding_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_detect_encoding_xml($string, $default_encoding = null)
{
    if (preg_match(_PCRE_XML_ENCODING, $string, $matches)) {
        return api_refine_encoding_id($matches[1]);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function esc_url($url, $protocols = null, $_context = 'display')
{
    //$original_url = $url;
    if ('' == $url) {
        return $url;
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml($string, $to_encoding, $from_encoding = null)
{
    return _api_convert_encoding_xml($string, $to_encoding, $from_encoding);
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_utf8_decode_xml($string, $to_encoding = 'UTF-8')
{
    return _api_convert_encoding_xml($string, $to_encoding, 'UTF-8');
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml($string, $to_encoding, $from_encoding = null)
{
    return _api_convert_encoding_xml($string, $to_encoding, $from_encoding);
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_underscore_to_camel_case($string, $capitalise_first_char = true)
{
    if ($capitalise_first_char) {
        $string = ucfirst($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml($string, $from_encoding = null)
{
    return _api_convert_encoding_xml($string, 'UTF-8', $from_encoding);
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

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

function api_set_encoding_html(&$string, $encoding)

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)

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

    $string = api_convert_encoding($string, $encoding, $old_encoding);

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

function api_detect_encoding_html($string)

Expected 57 spaces after parameter type; 1 found
Open

 * @param string $string the input full-html document

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

        if (empty($output_encoding)) {

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

function api_html_to_text($string)

Missing parameter name
Open

 * @param string                        the new encoding value to be set

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)

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

    $old_encoding = api_detect_encoding_html($string);

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

function _api_convert_encoding_xml(&$string, $to_encoding, $from_encoding)

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

        $from_encoding = api_detect_encoding_xml($string);

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

            $from_encoding

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

    global $_api_encoding;

You must use "/**" style comments for a function comment
Open

function _api_camelize($match)

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

function esc_url($url, $protocols = null, $_context = 'display')

Missing parameter name
Open

 * @param int       Count of chars

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

function cut($text, $maxchar, $embed = false): string

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

        $file_size = (round($file_size / 1024 * 100) / 100).'k';

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

        $file_size = (round($file_size / 1024 * 100) / 100).'k';

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

        $out_res = substr($out_res, 0, $number).$postfix;

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

function api_convert_encoding_xml($string, $to_encoding, $from_encoding = null)

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

    $text_length = api_strlen($text, $encoding);

Expected 50 spaces after parameter type; 1 found
Open

 * @param string $decimalPoint

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

    } elseif ($file_size >= 1048576) {

Missing parameter name
Open

 * @param $array

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

    if (strlen($out_res) > $number) {

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

function api_utf8_encode_xml($string, $from_encoding = null)

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

    global $_api_encoding;

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

    if ($capitalise_first_char) {

Doc comment for parameter $encoding does not match actual variable name $middle
Open

 * @param string $encoding (optional)   The encoding to be used. If it is omitted,

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)

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

function esc_url($url, $protocols = null, $_context = 'display')

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

    if ($file_size >= 1073741824) {

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

function underScoreToCamelCase($string, $capitalizeFirstCharacter = true)

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

                    api_convert_encoding($matches[1], $output_encoding, $input_encoding),

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

                    $output_encoding

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

        return api_convert_encoding(str_replace($matches[0], $replace, $string), $to_encoding, $from_encoding);

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

function api_contains_asciimathml($html)

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

    $out_res = str_replace(">", "> ", $out_res);

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

function float_format($number, $flag = 1, $decimalPoint = '.', $thousandsSeparator = ',')

Missing function doc comment
Open

function implode_with_key($glue, $array)

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

function api_convert_encoding_xml($string, $to_encoding, $from_encoding = null)

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

        return api_convert_encoding(str_replace($matches[0], $replace, $string), $to_encoding, $from_encoding);

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

function api_underscore_to_camel_case($string, $capitalise_first_char = true)

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

        $out_res = str_replace('"', "''", $out_res);

Missing parameter name
Open

 * @param $end string how the string will be ended

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

function trim_value(&$value)

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

    $out_res = api_remove_tags_with_space($text, false);

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

        $out_res = substr($out_res, 0, $number).$postfix;

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

            $replace = str_replace('standalone', ' encoding="'.$to_encoding.'" standalone', $matches[0]);

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

    return str_replace($matches[1], $_api_encoding, $matches[0]);

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

function format_file_size($file_size)

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

        $file_size = $file_size.'B';

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

function strip_tags_blacklist($html, $tags)

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

            $output_encoding = api_get_system_encoding();

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

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

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

    return _api_convert_encoding_xml($string, $to_encoding, 'UTF-8');

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

            '<?xml version="1.0" encoding="'.$to_encoding.'"?>'."\n".$string,

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

            $to_encoding,

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

function api_trunc_str($text, $length = 30, $suffix = '...', $middle = false, $encoding = null)

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

function get_last_week()

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

function api_utf8_encode_xml($string, $from_encoding = null)

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

function api_contains_asciisvg($html)

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

function api_camel_case_to_underscore($string)

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

    $out_res = $in_html;

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

    $out_res = str_replace(">", "> ", $out_res);

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

function _make_url_clickable_cb($matches)

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

function _make_web_ftp_clickable_cb($matches)

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

function format_file_size($file_size)

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

            $input_encoding = api_detect_encoding_html($string);

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

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

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

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

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

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

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

function _api_convert_encoding_xml(&$string, $to_encoding, $from_encoding)

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

    if (empty($from_encoding)) {

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

        $to_encoding,

Doc comment for parameter $middle does not match actual variable name $encoding
Open

 * @param bool   $middle   if this parameter is true, truncation is done in the middle of the string

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

    $out_res = strip_tags($out_res);

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

    if ($text_length <= $length) {

Missing parameter name
Open

 * @param bool      Whether to embed in a <span title="...">...</span>

Missing parameter name
Open

 * @param int       Decimal points 0=never, 1=if needed, 2=always

Missing parameter name
Open

 * @param $text string

Missing parameter name
Open

 * @param   string   Date in UTC (2010-01-01 12:12:12)

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

function substrwords(string $text, int $maxchar, string $end = '...'): string

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

function get_week_from_day($date)

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

function bracketsToArray($array)

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

function api_get_short_text_from_html($text, $number)

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

    return api_refine_encoding_id($default_encoding);

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

function api_convert_encoding_xml($string, $to_encoding, $from_encoding = null)

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

function _api_convert_encoding_xml(&$string, $to_encoding, $from_encoding)

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

    $_api_encoding = api_refine_encoding_id($to_encoding);

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)

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

    $out_res = $in_html;

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

    if ($in_double_quote_replace) {

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

    $file_size = (int) $file_size;

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

    $file_size = (int) $file_size;

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

        $default_encoding = _api_mb_internal_encoding();

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

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

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

function api_underscore_to_camel_case($string, $capitalise_first_char = true)

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)

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

        $out_res = str_replace('"', "''", $out_res);

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

    return $out_res;

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

        $file_size = (round($file_size / 1048576 * 100) / 100).'M';

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

    if (empty($default_encoding)) {

Missing parameter name
Open

 * @param mixed     Number to convert

Missing parameter name
Open

 * @param $maxchar int the max number of character

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

function implode_with_key($glue, $array)

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

        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';

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

    $to_encoding = api_refine_encoding_id($to_encoding);

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

        $from_encoding

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

function _api_camelize($match)

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

                $text_length,

Missing parameter name
Open

 * @param string    The text to "cut"

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

    } elseif ($file_size >= 1024) {

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

function api_get_filtered_multilingual_HTML_string($htmlString, $language = null)

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

        if (empty($input_encoding)) {

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

function api_detect_encoding_xml($string, $default_encoding = null)

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

            $replace = str_replace('?>', ' encoding="'.$to_encoding.'"?>', $matches[0]);

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

function _api_convert_encoding_xml_callback($matches)

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

        $file_size = $file_size.'B';

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

                    api_convert_encoding($matches[1], $output_encoding, $input_encoding),

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

function api_detect_encoding_xml($string, $default_encoding = null)

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

    $to_encoding = api_refine_encoding_id($to_encoding);

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

    $_api_encoding = api_refine_encoding_id($to_encoding);

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

    $out_res = strip_tags($out_res);

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

function _deep_replace($search, $subject)

Expected 50 spaces after parameter type; 1 found
Open

 * @param string $thousandsSeparator

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

        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';

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

        $file_size = (round($file_size / 1048576 * 100) / 100).'M';

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

    return $file_size;

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

    return $out_res;

The variable $from_encoding is not named in camelCase.
Open

function api_convert_encoding_xml($string, $to_encoding, $from_encoding = null)
{
    return _api_convert_encoding_xml($string, $to_encoding, $from_encoding);
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_set_encoding_html(&$string, $encoding)
{
    $old_encoding = api_detect_encoding_html($string);
    if (@preg_match('/(.*<head.*)(<meta[^>]*content=[^>]*>)(.*<\/head>.*)/si', $string, $matches)) {
        $meta = $matches[2];
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $default_encoding is not named in camelCase.
Open

function api_detect_encoding_xml($string, $default_encoding = null)
{
    if (preg_match(_PCRE_XML_ENCODING, $string, $matches)) {
        return api_refine_encoding_id($matches[1]);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_trunc_str($text, $length = 30, $suffix = '...', $middle = false, $encoding = null)
{
    if (empty($encoding)) {
        $encoding = api_get_system_encoding();
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_set_encoding_html(&$string, $encoding)
{
    $old_encoding = api_detect_encoding_html($string);
    if (@preg_match('/(.*<head.*)(<meta[^>]*content=[^>]*>)(.*<\/head>.*)/si', $string, $matches)) {
        $meta = $matches[2];
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_utf8_decode_xml($string, $to_encoding = 'UTF-8')
{
    return _api_convert_encoding_xml($string, $to_encoding, 'UTF-8');
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_trunc_str($text, $length = 30, $suffix = '...', $middle = false, $encoding = null)
{
    if (empty($encoding)) {
        $encoding = api_get_system_encoding();
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function _api_convert_encoding_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function _api_convert_encoding_xml_callback($matches)
{
    global $_api_encoding;

    return str_replace($matches[1], $_api_encoding, $matches[0]);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_trunc_str($text, $length = 30, $suffix = '...', $middle = false, $encoding = null)
{
    if (empty($encoding)) {
        $encoding = api_get_system_encoding();
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $default_encoding is not named in camelCase.
Open

function api_detect_encoding_xml($string, $default_encoding = null)
{
    if (preg_match(_PCRE_XML_ENCODING, $string, $matches)) {
        return api_refine_encoding_id($matches[1]);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_underscore_to_camel_case($string, $capitalise_first_char = true)
{
    if ($capitalise_first_char) {
        $string = ucfirst($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function _api_convert_encoding_xml_callback($matches)
{
    global $_api_encoding;

    return str_replace($matches[1], $_api_encoding, $matches[0]);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $default_encoding is not named in camelCase.
Open

function api_detect_encoding_xml($string, $default_encoding = null)
{
    if (preg_match(_PCRE_XML_ENCODING, $string, $matches)) {
        return api_refine_encoding_id($matches[1]);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml($string, $from_encoding = null)
{
    return _api_convert_encoding_xml($string, 'UTF-8', $from_encoding);
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_title_html(&$string, $output_encoding = null, $input_encoding = null)
{
    if (@preg_match('/<head.+<title[^>]*>(.*)<\/title>/msi', $string, $matches)) {
        if (empty($output_encoding)) {
            $output_encoding = api_get_system_encoding();
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function _api_convert_encoding_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml(&$string, $to_encoding, $from_encoding)
{
    if (empty($from_encoding)) {
        $from_encoding = api_detect_encoding_xml($string);
    }
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_short_text_from_html($text, $number)
{
    // Delete script and style tags
    $text = preg_replace('/(<(script|style)\b[^>]*>).*?(<\/\2>)/is', "$1$3", $text);
    $text = api_html_entity_decode($text);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_short_text_from_html($text, $number)
{
    // Delete script and style tags
    $text = preg_replace('/(<(script|style)\b[^>]*>).*?(<\/\2>)/is', "$1$3", $text);
    $text = api_html_entity_decode($text);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_short_text_from_html($text, $number)
{
    // Delete script and style tags
    $text = preg_replace('/(<(script|style)\b[^>]*>).*?(<\/\2>)/is', "$1$3", $text);
    $text = api_html_entity_decode($text);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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_xml($string, $to_encoding, $from_encoding = null)
{
    return _api_convert_encoding_xml($string, $to_encoding, $from_encoding);
}
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_remove_tags_with_space($in_html, $in_double_quote_replace = true)
{
    $out_res = $in_html;
    if ($in_double_quote_replace) {
        $out_res = str_replace('"', "''", $out_res);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_short_text_from_html($text, $number)
{
    // Delete script and style tags
    $text = preg_replace('/(<(script|style)\b[^>]*>).*?(<\/\2>)/is', "$1$3", $text);
    $text = api_html_entity_decode($text);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function api_get_short_text_from_html($text, $number)
{
    // Delete script and style tags
    $text = preg_replace('/(<(script|style)\b[^>]*>).*?(<\/\2>)/is', "$1$3", $text);
    $text = api_html_entity_decode($text);
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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

function format_file_size($file_size)
{
    $file_size = (int) $file_size;
    if ($file_size >= 1073741824) {
        $file_size = (round($file_size / 1073741824 * 100) / 100).'G';
Severity: Minor
Found in public/main/inc/lib/text.lib.php by phpmd

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