chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

    public function __construct(
        $pageFormat = 'A4',
        $orientation = 'P',
        $params = [],
        $template = null
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The method content_to_pdf() has an NPath complexity of 138240. The configured NPath complexity threshold is 200.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The method html_to_pdf() has an NPath complexity of 449304. The configured NPath complexity threshold is 200.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The method format_pdf() has an NPath complexity of 312. The configured NPath complexity threshold is 200.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

NPathComplexity

Since: 0.1

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

Example

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

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

The method content_to_pdf has 12 parameters. Consider reducing the number of parameters to less than 10.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

The method fixImagesPaths() has an NPath complexity of 1540. The configured NPath complexity threshold is 200.
Open

    private static function fixImagesPaths($documentHtml, array $courseInfo = null, $dirName = '')
    {
        $html = new HTML5();
        $doc = $html->loadHTML($documentHtml);

Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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 class PDF has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
Open

class PDF
{
    /** @var Mpdf */
    public $pdf;
    public $custom_header = [];
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

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

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 493.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 497.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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

Missing class import via use statement (line '420', column '20').
Open

        $doc = new DOMDocument();
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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

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

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 421.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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

Missing class import via use statement (line '108', column '24').
Open

            $tpl = new Template('', false, false, false, false, true, false);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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

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

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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

Missing class import via use statement (line '617', column '25').
Open

        $my_image = new Image($source_file);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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

            $view = new Template('', false, false, false, true, false, false);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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

        $view = new Template('', false, false, false, true, false, false);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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

        $view = new Template('', false, false, false, true, false, false);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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 '812', column '50').
Open

        $this->template = $this->template ?: new Template('', false, false, false, false, false, false);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

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

        } else {
            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path
            $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';
        }
Severity: Minor
Found in public/main/inc/lib/pdf.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 html_to_pdf_with_template uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $user_info = api_get_user_info();
            if ($this->params['show_teacher_as_myself']) {
                $teacher_list = $user_info['complete_name'];
            }
Severity: Minor
Found in public/main/inc/lib/pdf.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 delete_watermark uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // course path
            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';
        }
Severity: Minor
Found in public/main/inc/lib/pdf.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_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $this->pdf->SetHTMLHeader($this->custom_header, 'E');
                    $this->pdf->SetHTMLHeader($this->custom_header, 'O');
                }
Severity: Minor
Found in public/main/inc/lib/pdf.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 html_to_pdf_with_template uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $teacher_list = CourseManager::getTeacherListFromCourseCodeToString(
                    $this->params['course_code']
                );
            }
Severity: Minor
Found in public/main/inc/lib/pdf.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 html_to_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                if (2 === $counter && !empty($mainTitle)) {
                    $this->pdf->WriteHTML(
                        '<html><body><h2 style="text-align: center">'.$mainTitle.'</h2></body></html>'
                    );
Severity: Minor
Found in public/main/inc/lib/pdf.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_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                if (empty($this->custom_header)) {
                    $this->set_header($courseInfo);
                } else {
                    $this->pdf->SetHTMLHeader($this->custom_header, 'E');
Severity: Minor
Found in public/main/inc/lib/pdf.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 html_to_pdf_with_template uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $tpl = $this->template;
        }
Severity: Minor
Found in public/main/inc/lib/pdf.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_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $watermark_file = self::get_watermark(null);
                    if ($watermark_file) {
                        $this->pdf->SetWatermarkImage($watermark_file);
                        $this->pdf->showWatermarkImage = true;
Severity: Minor
Found in public/main/inc/lib/pdf.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 html_to_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                //we suppose we've only been sent a file path
                $htmlTitle = basename($file);
            }
Severity: Minor
Found in public/main/inc/lib/pdf.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 content_to_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $pdf_name = api_replace_dangerous_char($pdf_name);
            $output_file = $pdf_name.'.pdf';
        }
Severity: Minor
Found in public/main/inc/lib/pdf.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 get_watermark uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // course path
            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';
            if (file_exists($store_path)) {
                $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';
Severity: Minor
Found in public/main/inc/lib/pdf.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 content_to_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $this->pdf->Output(
                $output_file,
                $outputMode
            );
Severity: Minor
Found in public/main/inc/lib/pdf.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_pdf uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $this->pdf->SetHTMLFooter($this->custom_footer);
                }
Severity: Minor
Found in public/main/inc/lib/pdf.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 fixImagesPaths uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                if (false !== strpos($src, 'courses/'.$courseInfo['path'].'/document/')) {
                    $oldSrcFixed = str_replace('courses/'.$courseInfo['path'].'/document/', '', $src);
                } else {
                    // Try with the dirname if exists
Severity: Minor
Found in public/main/inc/lib/pdf.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 fixImagesPaths uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                    } else {
                        $documentPath = '';
                        $oldSrcFixed = $src;
                    }
Severity: Minor
Found in public/main/inc/lib/pdf.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 fixImagesPaths uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    // Try with the dirname if exists
                    if (file_exists($dirName.'/'.$src)) {
                        $documentPath = '';
                        $oldSrcFixed = $dirName.'/'.$src;
Severity: Minor
Found in public/main/inc/lib/pdf.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 '$courseCode'.
Open

    public function get_header($courseCode = null)
Severity: Minor
Found in public/main/inc/lib/pdf.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 local variables such as '$dirName'.
Open

                $dirName = $file_info['dirname'];
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused local variables such as '$protocol'.
Open

            $protocol = api_get_protocol();
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

Avoid unused parameters such as '$filename'.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
Severity: Minor
Found in public/main/inc/lib/pdf.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 private methods such as 'fixImagesPaths'.
Open

    private static function fixImagesPaths($documentHtml, array $courseInfo = null, $dirName = '')
    {
        $html = new HTML5();
        $doc = $html->loadHTML($documentHtml);

Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

UnusedPrivateMethod

Since: 0.2

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

Example

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

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

The property $custom_header is not named in camelCase.
Open

class PDF
{
    /** @var Mpdf */
    public $pdf;
    public $custom_header = [];
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $custom_footer is not named in camelCase.
Open

class PDF
{
    /** @var Mpdf */
    public $pdf;
    public $custom_header = [];
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $pdf_name is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $complete_style is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $source_file is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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

Doc comment for parameter $mainTitle does not match actual variable name $addStyle
Open

     * @param string $mainTitle

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

                $teacher_list = $user_info['complete_name'];

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

                $teacher_list = CourseManager::getTeacherListFromCourseCodeToString(

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

            $user_info = api_get_user_info();

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

        $tpl->assign('pdf_teachers', $teacher_list);

Member variable "custom_header" is not in valid camel caps format
Open

    public $custom_header = [];

Doc comment for parameter $addStyle does not match actual variable name $complete_style
Open

     * @param bool   $addStyle

Method name "PDF::html_to_pdf_with_template" is not in camel caps format
Open

    public function html_to_pdf_with_template(

Doc comment for parameter $complete_style does not match actual variable name $printTitle
Open

     * @param bool   $complete_style show header and footer if true

Member variable "custom_footer" is not in valid camel caps format
Open

    public $custom_footer = [];

Missing parameter name
Open

     * @param array

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

                $teacher_list = SessionManager::getCoachesByCourseSessionToString(

Method name "PDF::html_to_pdf" is not in camel caps format
Open

    public function html_to_pdf(

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

                $teacher_list = $user_info['complete_name'];

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

        $teacher_list = null;

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

        $complete_style = true,

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

                $css = file_exists($css_file) ? @file_get_contents($css_file) : '';

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

            $extension = $file_info['extension'];

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

        $document_html,

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

        $document_html = preg_replace($clean_search, '', $document_html);

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

        $document_html = str_replace(api_get_path(WEB_ARCHIVE_PATH), api_get_path(SYS_ARCHIVE_PATH), $document_html);

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

            $output_file = $pdf_name.'.pdf';

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

            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';

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

            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path

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

            $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/pdf_watermark.png';

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

        $course_image = $store_path.'/'.$urlId.'_pdf_watermark.png';

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

            $teacher_list = CourseManager::get_teacher_list_from_course_code($courseInfo['code']);

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

        $this->custom_header = $header;

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

        $this->custom_footer = $footer;

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

        $clean_search = [

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

                $documentHtml = preg_replace($clean_search, '', $documentHtml);

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

            return "<style>$css</style>".$document_html;

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

        return $output_file;

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

            unlink($store_path);

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

            $course_info = api_get_course_info($courseCode);

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

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

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

                $css = file_exists($css_file) ? @file_get_contents($css_file) : '';

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

        $document_html = str_replace('../', '', $document_html);

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

        $document_html = str_replace(

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

            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.$urlId.'_pdf_watermark.png';

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

            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.$urlId.'_pdf_watermark.png';

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

            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';

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

        $result = $my_image->send_image($course_image, -1, 'png');

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

        $result = $my_image->send_image($course_image, -1, 'png');

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

                    $this->pdf->SetHTMLHeader($this->custom_header, 'E');

Method name "PDF::content_to_pdf" is not in camel caps format
Open

    public function content_to_pdf(

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

        if (empty($document_html)) {

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

        @$doc->loadHTML('<?xml encoding="UTF-8">' . $document_html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);

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

                $output_file,

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

        if (file_exists($course_image)) {

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

        $my_image = new Image($source_file);

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

            $result = $web_path;

Method name "PDF::set_custom_header" is not in camel caps format
Open

    public function set_custom_header($header)

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

                $absolute_css_path = api_get_path(WEB_CODE_PATH).'css/'.api_get_setting('stylesheets.stylesheets').'/frames.css';

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

                $documentHtml = str_replace('href="./css/frames.css"', $absolute_css_path, $documentHtml);

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

        $pdf_name = '',

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

            $document_html

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

                $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.$urlId.'_pdf_watermark.png';

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

    public static function upload_watermark($filename, $source_file, $courseCode = null)

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

            $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';

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

        $document_html = preg_replace($clean_search, '', $document_html);

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

                    $old_src = $item->getAttribute('src');

Method name "PDF::delete_watermark" is not in camel caps format
Open

    public static function delete_watermark($courseCode = null)

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

        $document_html = str_replace(api_get_path(WEB_ARCHIVE_PATH), api_get_path(SYS_ARCHIVE_PATH), $document_html);

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

            $course_info = api_get_course_info($courseCode);

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

        $course_image = $store_path.'/'.$urlId.'_pdf_watermark.png';

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

            @unlink($course_image);

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

                    $this->pdf->SetWatermarkImage($watermark_file);

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

                $watermark_text = api_get_setting('document.pdf_export_watermark_text');

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

            $document_html

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

        api_set_encoding_html($document_html, 'UTF-8');

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

        if (empty($pdf_name)) {

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

            $output_file = 'pdf_'.date('Y-m-d-his').'.pdf';

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

            $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/pdf_watermark.png';

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

                $watermark_file = self::get_watermark($courseCode);

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

                $dirName = $file_info['dirname'];

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

        $document_html = str_replace('<?xml encoding="UTF-8">', '', $document_html);

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

            if (file_exists($store_path)) {

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

            $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images'; // course path

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

                        $watermark_text = $courseWaterMark;

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

        $document_html = str_replace('<?xml encoding="UTF-8">', '', $document_html);

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

        @$this->pdf->WriteHTML($document_html);

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

            $output_file = api_get_path(SYS_ARCHIVE_PATH).$output_file;

Missing parameter name
Open

     * @param   mixed   web path of the watermark image, false if there is nothing to return

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

        $web_path = false;

Method name "PDF::get_header" is not in camel caps format
Open

    public function get_header($courseCode = null)

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

            if (!empty($teacher_list)) {

Method name "PDF::set_custom_footer" is not in camel caps format
Open

    public function set_custom_footer($footer)

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

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

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

                $css_file = api_get_path(SYS_CSS_PATH).'/print.css';

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

        $clean_search = [

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

            $pdf_name = api_replace_dangerous_char($pdf_name);

Method name "PDF::get_watermark" is not in camel caps format
Open

    public static function get_watermark($courseCode = null)

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

        return $web_path;

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

            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path']; // course path

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

                if ($watermark_file) {

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

        self::format_pdf($courseInfo, $complete_style);

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

            $file_info = pathinfo($file);

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

        $document_html = preg_replace($clean_search, '', $document_html);

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

                $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.$urlId.'_pdf_watermark.png';

Missing function doc comment
Open

    public function setCertificateFooter()

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

                if (!empty($watermark_text)) {

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

                    $this->pdf->SetHTMLFooter($this->custom_footer);

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

                $filename = $file_info['basename'];

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

        $document_html = $doc->saveHTML();

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

            $output_file = $pdf_name.'.pdf';

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

            $output_file = api_get_path(SYS_ARCHIVE_PATH).$output_file;

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

                $web_path = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/'.$urlId.'_pdf_watermark.png';

Expected 71 spaces after parameter type; 1 found
Open

     * @param string $courseCode course code (optional)

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

        if (file_exists($store_path)) {

Method name "PDF::upload_watermark" is not in camel caps format
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)

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

                    $watermark_file = self::get_watermark(null);

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

                    $this->pdf->SetHTMLHeader($this->custom_header, 'O');

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

    public function replaceIconsWithImages(string $content): string

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

            $pdf_name = api_replace_dangerous_char($pdf_name);

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

            if (file_exists($store_path)) {

Missing parameter name
Open

     * @param   mixed   web path of the watermark image, false if there is nothing to return

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

            $course_info = api_get_course_info($courseCode);

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

            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.$urlId.'_pdf_watermark.png';

Method name "PDF::set_footer" is not in camel caps format
Open

    public function set_footer()

Method name "PDF::set_header" is not in camel caps format
Open

    public function set_header($courseInfo)

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

                foreach ($teacher_list as $teacher) {

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

                        $this->pdf->SetWatermarkImage($watermark_file);

Superfluous parameter comment
Open

     * @param string $dest     Optional. Directory to move file

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

        $document_html = str_replace('../../', '', $document_html);

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

        $document_html = str_replace('../../', '', $document_html);

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

            $store_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/'.$urlId.'_pdf_watermark.png';

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

                        strcode2utf($watermark_text),

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

        $document_html = str_replace('../', '', $document_html);

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

        $document_html = str_replace(

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

                    if (in_array($old_src, $replaced)) {

Missing parameter name
Open

     * @param   string  course code (optional)

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

        $my_image = new Image($source_file);

Method name "PDF::format_pdf" is not in camel caps format
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)

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

                    if ($watermark_file) {

The variable $teacher_list is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $pdf_name is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function delete_watermark($courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_image is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_file is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function delete_watermark($courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $web_path is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $clean_search is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $web_path is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_text is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $css_file is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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_file is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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_file is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $teacher_list is not named in camelCase.
Open

    public function set_header($courseInfo)
    {
        $this->pdf->defaultheaderfontsize = 10; // in pts
        $this->pdf->defaultheaderfontstyle = 'BI'; // blank, B, I, or BI
        $this->pdf->defaultheaderline = 1; // 1 to include line below header/above footer
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_file is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $absolute_css_path is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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_file is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $web_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $user_info is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $css_file is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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_file is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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_file is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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_file is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_image is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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_info is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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_info is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $web_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $web_path is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_file is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_file is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $teacher_list is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $complete_style is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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_src is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $source_file is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_text is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $clean_search is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $clean_search is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $clean_search is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $pdf_name is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $teacher_list is not named in camelCase.
Open

    public function set_header($courseInfo)
    {
        $this->pdf->defaultheaderfontsize = 10; // in pts
        $this->pdf->defaultheaderfontstyle = 'BI'; // blank, B, I, or BI
        $this->pdf->defaultheaderline = 1; // 1 to include line below header/above footer
Severity: Minor
Found in public/main/inc/lib/pdf.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 $teacher_list is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $teacher_list is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $pdf_name is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $web_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function delete_watermark($courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $user_info is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $pdf_name is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function delete_watermark($courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_file is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_text is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_image is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $teacher_list is not named in camelCase.
Open

    public function set_header($courseInfo)
    {
        $this->pdf->defaultheaderfontsize = 10; // in pts
        $this->pdf->defaultheaderfontstyle = 'BI'; // blank, B, I, or BI
        $this->pdf->defaultheaderline = 1; // 1 to include line below header/above footer
Severity: Minor
Found in public/main/inc/lib/pdf.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 $css_file is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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_info is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $store_path is not named in camelCase.
Open

    public static function delete_watermark($courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $my_image is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $teacher_list is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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_info is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $absolute_css_path is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $web_path is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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_src is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function delete_watermark($courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $document_html is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $my_image is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_info is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_file is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 $course_image is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.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 $watermark_text is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.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 method content_to_pdf is not named in camelCase.
Open

    public function content_to_pdf(
        $document_html,
        ?string $css = null,
        $pdf_name = '',
        $courseCode = null,
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_header is not named in camelCase.
Open

    public function get_header($courseCode = null)
    {
        /*$header = api_get_setting('pdf_export_watermark_text');
        if (!empty($courseCode) && api_get_setting('pdf_export_watermark_by_course') == 'true') {
            $header = api_get_course_setting('pdf_export_watermark_text');
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method html_to_pdf is not named in camelCase.
Open

    public function html_to_pdf(
        $htmlFileArray,
        $pdfName = '',
        $courseCode = null,
        $printTitle = false,
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method html_to_pdf_with_template is not named in camelCase.
Open

    public function html_to_pdf_with_template(
        $content,
        $saveToFile = false,
        $returnHtml = false,
        $addDefaultCss = false,
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method delete_watermark is not named in camelCase.
Open

    public static function delete_watermark($courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method upload_watermark is not named in camelCase.
Open

    public static function upload_watermark($filename, $source_file, $courseCode = null)
    {
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' === api_get_setting('document.pdf_export_watermark_by_course')) {
            $course_info = api_get_course_info($courseCode);
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_header is not named in camelCase.
Open

    public function set_header($courseInfo)
    {
        $this->pdf->defaultheaderfontsize = 10; // in pts
        $this->pdf->defaultheaderfontstyle = 'BI'; // blank, B, I, or BI
        $this->pdf->defaultheaderline = 1; // 1 to include line below header/above footer
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_footer is not named in camelCase.
Open

    public function set_footer()
    {
        $this->pdf->defaultfooterfontsize = 12; // in pts
        $this->pdf->defaultfooterfontstyle = 'B'; // blank, B, I, or BI
        $this->pdf->defaultfooterline = 1; // 1 to include line below header/above footer
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_custom_footer is not named in camelCase.
Open

    public function set_custom_footer($footer)
    {
        $this->custom_footer = $footer;
    }
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method set_custom_header is not named in camelCase.
Open

    public function set_custom_header($header)
    {
        $this->custom_header = $header;
    }
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method format_pdf is not named in camelCase.
Open

    public function format_pdf($courseInfo, $complete = true, $disablePagination = false)
    {
        $courseCode = null;
        if (!empty($courseInfo)) {
            $courseCode = $courseInfo['code'];
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method get_watermark is not named in camelCase.
Open

    public static function get_watermark($courseCode = null)
    {
        $web_path = false;
        $urlId = api_get_current_access_url_id();
        if (!empty($courseCode) && 'true' == api_get_setting('document.pdf_export_watermark_by_course')) {
Severity: Minor
Found in public/main/inc/lib/pdf.lib.php by phpmd

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status