YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Workflows/models/RecordStructure.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Vtiger_Loader' in method 'getInstanceForWorkFlowModule'.
Open

        $className = Vtiger_Loader::getComponentClassName('Model', $mode . 'RecordStructure', 'Settings:Workflows');

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

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

Reference to undeclared property \Settings_Workflows_RecordStructure_Model->workFlowModel
Open

        return $this->workFlowModel;

Reference to undeclared property \Settings_Workflows_RecordStructure_Model->workFlowModel (Did you mean $workFlowModel)
Open

        $this->workFlowModel = $workFlowModel;

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

class Settings_Workflows_RecordStructure_Model extends Vtiger_RecordStructure_Model

The class Settings_Workflows_RecordStructure_Model is not named in CamelCase.
Open

class Settings_Workflows_RecordStructure_Model extends Vtiger_RecordStructure_Model
{
    /**
     * Record structure default mode.
     *

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

     *

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

     *

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

    const RECORD_STRUCTURE_MODE_FILTER = 'Filter';

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

     * Set workflow model.

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

    public function setWorkFlowModel($workFlowModel)

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

        return $instance;

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 getWorkFlowModel()

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

        return $this->workFlowModel;

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

     * @param string $mode

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

        $instance = new $className();

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

     * @param object $workFlowModel

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

     * Get workflow model.

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

     * @return object

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

    const RECORD_STRUCTURE_MODE_DEFAULT = '';

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

     * @var string

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

    {

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

     * @return object

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 object $workFlowModel

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

        $className = Vtiger_Loader::getComponentClassName('Model', $mode . 'RecordStructure', 'Settings:Workflows');

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

     */

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

     * Record structure mode filter.

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

     *

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

        $instance->setModule($workFlowModel->getModule());

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

     * Record structure default mode.

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

        $instance->setWorkFlowModel($workFlowModel);

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

    /**

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

     * Get instance for workflow module.

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

     *

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

     * @var string

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

    /**

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

        $this->workFlowModel = $workFlowModel;

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

    public static function getInstanceForWorkFlowModule($workFlowModel, $mode)

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

    {

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

    }

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

class Settings_Workflows_RecordStructure_Model extends Vtiger_RecordStructure_Model

There are no issues that match your filters.

Category
Status