chamilo/chamilo-lms

View on GitHub
public/plugin/customcertificate/src/CustomCertificatePlugin.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '263', column '44').
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

The property $course_settings is not named in camelCase.
Open

class CustomCertificatePlugin extends Plugin
{
    const TABLE_CUSTOMCERTIFICATE = 'plugin_customcertificate';
    public $isCoursePlugin = true;

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_data" is not in valid camel caps format
Open

                if ($certificate->user_id == api_get_user_id() && !empty($certificate->certificate_data)) {

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

    public $course_settings = [

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

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

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

                if ($certificate->user_id == api_get_user_id() && !empty($certificate->certificate_data)) {

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

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

There are no issues that match your filters.

Category
Status