YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/handlers/AutoFillIban.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Missing class import via use statement (line '28', column '22').
Open

                $ibanField = new \App\Fields\Iban();

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

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Vtiger_AutoFillIban_Handler

The class Vtiger_AutoFillIban_Handler is not named in CamelCase.
Open

class Vtiger_AutoFillIban_Handler
{
    /**
     * EntityBeforeSave function.
     *

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Line exceeds 120 characters; contains 150 characters
Open

                $recordModel->set($field->getName(), $ibanValue)->setDataForSave([$field->getTableName() => [$field->getColumnName() => $ibanValue]]);

Spaces must be used to indent lines; tabs are not allowed
Open

        $recordModel = $eventHandler->getRecordModel();

Spaces must be used to indent lines; tabs are not allowed
Open

                $fieldParams = $field->getFieldParams();

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($recordModel->getModule()->getFieldsByType('iban', true) as $field) {

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function entityBeforeSave(App\EventHandler $eventHandler): void

Spaces must be used to indent lines; tabs are not allowed
Open

            if (!$field->hasDefaultValue() && $recordModel->isEmpty($field->getName())) {

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * EntityBeforeSave function.

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                $ibanField = new \App\Fields\Iban();

Spaces must be used to indent lines; tabs are not allowed
Open

                $recordModel->set($field->getName(), $ibanValue)->setDataForSave([$field->getTableName() => [$field->getColumnName() => $ibanValue]]);

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param App\EventHandler $eventHandler

Spaces must be used to indent lines; tabs are not allowed
Open

                $ibanValue = $ibanField->getIbanValue($fieldParams, $recordModel);

Class name "Vtiger_AutoFillIban_Handler" is not in camel caps format
Open

class Vtiger_AutoFillIban_Handler

There are no issues that match your filters.

Category
Status