YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/ModuleManager/actions/Library.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Settings_ModuleManager_Library_Model' in method 'download'.
Open

        Settings_ModuleManager_Library_Model::download($request->getByType('name', 'Alnum'));

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

Avoid using static access to class 'Settings_ModuleManager_Library_Model' in method 'update'.
Open

        Settings_ModuleManager_Library_Model::update($request->getByType('name', 'Alnum'));

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

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

class Settings_ModuleManager_Library_Action extends Settings_Vtiger_Basic_Action

The class Settings_ModuleManager_Library_Action is not named in CamelCase.
Open

class Settings_ModuleManager_Library_Action extends Settings_Vtiger_Basic_Action
{
    use \App\Controller\ExposeMethod;

    public function __construct()

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

        parent::__construct();

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

        $this->exposeMethod('update');

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

    /**

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

        header('location: index.php?module=ModuleManager&parent=Settings&view=List');

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->exposeMethod('download');

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

    public function update(App\Request $request)

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

        Settings_ModuleManager_Library_Model::update($request->getByType('name', 'Alnum'));

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

    use \App\Controller\ExposeMethod;

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

     * Function to update library.

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

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

     * @param \App\Request $request

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

        Settings_ModuleManager_Library_Model::download($request->getByType('name', 'Alnum'));

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

        header('location: index.php?module=ModuleManager&parent=Settings&view=List');

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

     */

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

     * Function to download library.

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

    public function download(App\Request $request)

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

     * @param \App\Request $request

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

class Settings_ModuleManager_Library_Action extends Settings_Vtiger_Basic_Action

There are no issues that match your filters.

Category
Status