chamilo/chamilo-lms

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

Summary

Maintainability
A
0 mins
Test Coverage

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

    public function __construct(
        $certificate_id = 0,
        $userId = 0,
        $sendNotification = false,
        $updateCertificateData = true,

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

    public function generateCustomCertificate(string $fileName = ''): string
    {
        $certificateRepo = Container::getGradeBookCertificateRepository();
        $certificateRepo->registerUserInfoAboutCertificate(0, $this->user_id, 100, $fileName);

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

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $params['right'] = 0;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $params['top'] = 0;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $params['left'] = 0;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $pdf = new PDF($page_format, $params['orientation'], $params);

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$myCertificate' which will lead to PHP notices.
Open

        $tplContent->assign('certificate_generated_date', isset($myCertificate['created_at']) ? api_get_local_time($myCertificate['created_at']) : '');

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$myCertificate' which will lead to PHP notices.
Open

                $myCertificate['created_at'] ?? null,

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

            $params['orientation'] = $orientation;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $page_format = 'landscape' == $params['orientation'] ? 'A4-L' : 'A4';

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $params['orientation'] = 'landscape';

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$myCertificate' which will lead to PHP notices.
Open

        $tplContent->assign('certificate_generated_date', isset($myCertificate['created_at']) ? api_get_local_time($myCertificate['created_at']) : '');

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $params['bottom'] = 0;

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$params' which will lead to PHP notices.
Open

        $pdf = new PDF($page_format, $params['orientation'], $params);

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

The class Certificate has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13.
Open

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

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

Missing class import via use statement (line '393', column '19').
Open

        throw new \Exception('generateQRImage');

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 '178', column '26').
Open

            $skill = new SkillModel();

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 '617', column '39').
Open

                        $lpList = new LearnpathList(

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

        $extraFieldValue = new ExtraFieldValue('user');

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

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

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

        $pdf = new PDF($page_format, $params['orientation'], $params);

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

        $tplContent = new Template(null, false, false, false, false, false);

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 '490', column '26').
Open

        $gradeBook = new Gradebook();

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 '659', column '22').
Open

        $skill = new SkillModel();

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 '554', column '40').
Open

                $extraFieldValue = new ExtraFieldValue('user_certificate');

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

        $controller = new IndexManager(get_lang('My courses'));

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

        } else {
            $name = hash('sha256', $this->user_id . $categoryId);
            $fileName = $name . '.html';
            $certificateContent = $this->generateCustomCertificate($fileName);

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

        } else {
            //$this->checkCertificatePath();
            if ('true' === api_get_setting('document.allow_general_certificate')) {
                // General certificate
                $categoryId = isset($this->certificate_data['cat_id']) ? (int) $this->certificate_data['cat_id'] : 0;

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

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

                    } else {
                        // Creating new name
                        $name = hash('sha256', $this->user_id . $categoryId);
                        $fileName = $name . '.html';
                        $gradebookCertificateRepo = Container::getGradeBookCertificateRepository();

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 local variables such as '$id2'.
Open

            [$id, $id2, $termsValidationDate] = explode(':', $value['value']);

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

            [$id, $id2, $termsValidationDate] = explode(':', $value['value']);

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

The property $certificate_data is not named in camelCase.
Open

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

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

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

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

    public function __construct(
        $certificate_id = 0,
        $userId = 0,
        $sendNotification = false,
        $updateCertificateData = true,

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The property $certification_web_user_path is not named in camelCase.
Open

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

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

    public function updateUserCertificateInfo(
        $categoryId,
        $user_id,
        $path_certificate,
        $updateCertificateData = true

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The property $qr_file is not named in camelCase.
Open

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

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

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

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

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

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

    public function updateUserCertificateInfo(
        $categoryId,
        $user_id,
        $path_certificate,
        $updateCertificateData = true

CamelCaseParameterName

Since: 0.2

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

Example

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

Source

The property $user_id is not named in camelCase.
Open

class Certificate extends Model
{
    public $table;
    public $columns = [
        'id',

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

        if (!empty($certificate_id)) {

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

            $certificate = $this->get($certificate_id);

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

            $isCertificateAvailableInCategory = !empty($categoryId) && $myCategory[0]->is_certificate_available($this->user_id);

Expected 3 spaces after parameter type; 1 found
Open

     * @param bool $sendNotification      send message to student

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

            $categoryId = isset($this->certificate_data['cat_id']) ? (int) $this->certificate_data['cat_id'] : 0;

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

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

Expected 3 spaces after parameter type; 1 found
Open

     * @param bool $updateCertificateData

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

                $this->user_id = $this->certificate_data['user_id'];

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

        if ($this->user_id) {

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

                    $this->certificate_data['path_certificate'] = $fileName;

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

                    $myPathCertificate = $this->certificate_data['path_certificate'] ?? '';

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

        $this->user_id = !empty($userId) ? $userId : api_get_user_id();

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

            if ($this->force_certificate_generation) {

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

                && $this->certificate_data

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

                        $this->user_id,

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

            $gradebookCertificateRepo->deleteCertificateAndRelatedFiles($this->certificate_data['user_id'], $categoryId);

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

                && empty($this->certificate_data['path_certificate'])

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

            $this->html_file = $this->certificate_data['path_certificate'];

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

                $personalFile = $gradebookCertificateRepo->generateCertificatePersonalFile($this->user_id, $fileName, $content);

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

                $this->user_id,

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

    public $html_file = null;

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

                $this->certificate_data = $certificate;

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

        $certificate_id = 0,

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

                isset($this->certificate_data)

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

    public $certification_user_path = null;

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

    public $certification_web_user_path = null;

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

    public $qr_file = null;

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

                $categoryId = isset($this->certificate_data['cat_id']) ? (int) $this->certificate_data['cat_id'] : 0;

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

    public $user_id;

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

    public $force_certificate_generation = true;

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

            !empty($this->certification_user_path) &&

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

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

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

        if (isset($this->certificate_data['cat_id'])) {

Expected 4 spaces after parameter type; 2 found
Open

     * @param int  $certificate_id        ID of the certificate

Expected 4 spaces after parameter type; 2 found
Open

     * @param int  $userId

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

                $categoryId = isset($this->certificate_data['cat_id']) ? (int) $this->certificate_data['cat_id'] : 0;

Superfluous parameter comment
Open

     * @param bool $force_delete

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

            $this->html_file = $this->certificate_data['path_certificate'];

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

                $this->user_id = $this->certificate_data['user_id'];

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

            $categoryId = isset($this->certificate_data['cat_id']) ? (int) $this->certificate_data['cat_id'] : 0;

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

            $categoryId = (int) $this->certificate_data['cat_id'];

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

    public $certificate_data = [];

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

            isset($this->certificate_data['path_certificate'])

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

                        !$this->force_certificate_generation

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

                $name = hash('sha256', $this->user_id . $categoryId);

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

                    $this->user_id,

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

        if (isset($certificate_id) &&

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

            $personalFile = $gradebookCertificateRepo->generateCertificatePersonalFile($this->user_id, $fileName, $certificateContent);

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

                        path_certificate="'.Database::escape_string($path_certificate).'",

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

            !empty($this->certificate_data['path_certificate'])

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

                isset($this->certificate_data['id'])

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

        $pdf = new PDF($page_format, $params['orientation'], $params);

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

                        $personalFile = $gradebookCertificateRepo->generateCertificatePersonalFile($this->user_id, $fileName, $newContentHtml['content']);

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

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

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

                $final_content[$my_header] = $value;

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

                $final_content[$my_header] = $value;

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

            'URL'.': '.$final_content['certificate_link'];

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

            if ($this->user_id == api_get_user_id() &&

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

                $certificateId = $this->certificate_data['id'];

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

                                        api_get_user_info($this->user_id),

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

            get_lang('Trainer').': '.$final_content['teacher_firstname'].' '.$final_content['teacher_lastname'].$break_space.

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

            get_lang('Date').': '.$final_content['date_certificate'].$break_space.

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

                            $this->user_id,

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

                            $this->certificate_data['path_certificate'] = $fileName;

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

            $name = hash('sha256', $this->user_id . $categoryId);

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

        $path_certificate,

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

            get_lang('Learner').': '.$final_content['user_firstname'].' '.$final_content['user_lastname'].$break_space.

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

            get_lang('Learner').': '.$final_content['user_firstname'].' '.$final_content['user_lastname'].$break_space.

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

        if (!isset($this->certificate_data, $this->certificate_data['cat_id'])) {

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

        if ($filesystem->fileExists($this->certificate_data['path_certificate'])) {

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

                        'item_id' => $this->certificate_data['id'],

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

        $skills = $skill->getStudentSkills($this->user_id, 2);

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

                $this->certificate_data['file_content'] = $personalRepo->getResourceFileContent($personalFile);

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

            $final_content['gradebook_sitename'].' - '.

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

            get_lang('Score').': '.$final_content['gradebook_grade'].$break_space.

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

        $certificateRepo->registerUserInfoAboutCertificate(0, $this->user_id, 100, $fileName);

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

                $my_header = str_replace(['((', '))'], '', $headers[$key]);

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

            $final_content['gradebook_institution'].' - '.

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

            get_lang('Certification').$break_space.

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

            get_lang('Trainer').': '.$final_content['teacher_firstname'].' '.$final_content['teacher_lastname'].$break_space.

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

            $certificateContent .= $filesystem->read($this->certificate_data['path_certificate']);

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

                                    $score = $this->certificate_data['score_certificate'];

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

                $this->certificate_data['path_certificate'] = $fileName;

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

            get_lang('Trainer').': '.$final_content['teacher_firstname'].' '.$final_content['teacher_lastname'].$break_space.

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

            get_lang('Date').': '.$final_content['date_certificate'].$break_space.

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

        $sessions = SessionManager::get_sessions_by_user($this->user_id, false, true);

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

        $user_id = (int) $user_id;

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

        if (!isset($this->certificate_data, $this->certificate_data['cat_id'])) {

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

                        $name = hash('sha256', $this->user_id . $categoryId);

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

        $gradeBookInfo = $gradeBook->get($this->certificate_data['cat_id']);

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

                            $this->certification_user_path = $fileName;

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

            $this->certificate_data['file_content'],

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

        $user_id,

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

            !UserManager::is_user_certified($categoryId, $user_id)

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

            isset($this->certificate_data['path_certificate']) &&

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

        $final_content = [];

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

            get_lang('Learner').': '.$final_content['user_firstname'].' '.$final_content['user_lastname'].$break_space.

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

                            $this->user_id,

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

        $page_format = 'landscape' == $params['orientation'] ? 'A4-L' : 'A4';

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

        $user_id = (int) $user_id;

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

        if (!empty($this->certificate_data) &&

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

            get_lang('Score').': '.$final_content['gradebook_grade'].$break_space.

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

                            $this->user_id,

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

            $this->user_id,

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

        $break_space = " \n\r ";

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

        if (!$filesystem->fileExists($this->certificate_data['path_certificate'])) {

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

                                $this->user_id,

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

        $userInfo = api_get_user_info($this->user_id);

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

        if (empty($this->certificate_data['path_certificate'])) {

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

                                $this->certificate_data['cat_id'],

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

                    WHERE cat_id = "'.$categoryId.'" AND user_id="'.$user_id.'" ';

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

                !empty($this->certificate_data) &&

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

        $value = $extraFieldValue->get_values_by_handler_and_field_variable($this->user_id, 'legal_accept');

Expected 0 spaces after opening bracket; newline found
Open

            if (

The variable $path_certificate is not named in camelCase.
Open

    public function updateUserCertificateInfo(
        $categoryId,
        $user_id,
        $path_certificate,
        $updateCertificateData = true

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function updateUserCertificateInfo(
        $categoryId,
        $user_id,
        $path_certificate,
        $updateCertificateData = true

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function updateUserCertificateInfo(
        $categoryId,
        $user_id,
        $path_certificate,
        $updateCertificateData = true

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function updateUserCertificateInfo(
        $categoryId,
        $user_id,
        $path_certificate,
        $updateCertificateData = true

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $certificate_id is not named in camelCase.
Open

    public function __construct(
        $certificate_id = 0,
        $userId = 0,
        $sendNotification = false,
        $updateCertificateData = true,

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $certificate_id is not named in camelCase.
Open

    public function __construct(
        $certificate_id = 0,
        $userId = 0,
        $sendNotification = false,
        $updateCertificateData = true,

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $certificate_id is not named in camelCase.
Open

    public function __construct(
        $certificate_id = 0,
        $userId = 0,
        $sendNotification = false,
        $updateCertificateData = true,

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $user_id is not named in camelCase.
Open

    public function updateUserCertificateInfo(
        $categoryId,
        $user_id,
        $path_certificate,
        $updateCertificateData = true

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $page_format is not named in camelCase.
Open

    public function generatePdfFromCustomCertificate(): void
    {
        $orientation = api_get_setting('document.certificate_pdf_orientation');

        $params['orientation'] = 'landscape';

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $break_space is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $page_format is not named in camelCase.
Open

    public function generatePdfFromCustomCertificate(): void
    {
        $orientation = api_get_setting('document.certificate_pdf_orientation');

        $params['orientation'] = 'landscape';

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $break_space is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $break_space is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $break_space is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $break_space is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $break_space is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

The variable $final_content is not named in camelCase.
Open

    public function parseCertificateVariables($array)
    {
        $headers = $array[0];
        $content = $array[1];
        $final_content = [];

CamelCaseVariableName

Since: 0.2

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

Example

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

Source

There are no issues that match your filters.

Category
Status