YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Companies/views/EditModal.php

Summary

Maintainability
A
0 mins
Test Coverage

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

            $company = new Settings_Companies_Record_Model();

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

Avoid using static access to class '\App\Company' in method 'process'.
Open

        $company = \App\Company::getCompany();

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

syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open

    protected bool $blurBackground = true;

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

class Settings_Companies_EditModal_View extends \App\Controller\ModalSettings

The class Settings_Companies_EditModal_View is not named in CamelCase.
Open

class Settings_Companies_EditModal_View extends \App\Controller\ModalSettings
{
    /**
     * Registration modal event parameters.
     */

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

    public const MODAL_EVENT = [

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

            'data' => ['isForced' => true],

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

        ],

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

        'execution' => 'constant',

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

        'type' => 'modal',

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

     */

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

            'type' => 'GET',

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

    /** {@inheritdoc} */

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

        }

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

    /** {@inheritdoc} */

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

        if (!$company) {

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

        'name' => 'YetiForceRegistration',

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

        $viewer->assign('RECORD_ID', $company['id']);

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

    /** {@inheritdoc} */

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

        'url' => [

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 $showFooter = false;

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

    /** {@inheritdoc} */

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

    public function process(App\Request $request): void

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

        $viewer = $this->getViewer($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

        $viewer->view('EditModal.tpl', $request->getModule(false));

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 $modalSize = 'modal-full';

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

    protected bool $blurBackground = true;

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

     */

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

            'url' => 'index.php?parent=Settings&module=Companies&view=EditModal',

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

    /** @var string The name of the send button. */

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

    public $successBtn = 'LBL_SEND';

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

    protected bool $draggable = false;

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

    /** {@inheritdoc} */

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

    /**

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

     * Registration modal event parameters.

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

    /** {@inheritdoc} */

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

    /** {@inheritdoc} */

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

    public $pageTitle = 'LBL_YETIFORCE_REGISTRATION';

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

        $company = \App\Company::getCompany();

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

    public $modalIcon = 'fas fa-globe';

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

        $viewer->assign('RECORD_MODEL', $company);

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

        if (\App\User::getCurrentUserModel()->isAdmin()) {

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

     * {@inheritdoc}

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

    public $lockExit = true;

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

            $company = new Settings_Companies_Record_Model();

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

        $viewer->assign('IS_MODAL', true);

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

            $viewer->assign('EMAIL_URL', Settings_Companies_EmailVerificationModal_View::MODAL_EVENT['url']);

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

class Settings_Companies_EditModal_View extends \App\Controller\ModalSettings

There are no issues that match your filters.

Category
Status