YetiForceCompany/YetiForceCRM

View on GitHub
app/Controller/Components/View/YetiForceDetailModal.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Version' in method 'getPageTitle'.
Open

        $version = \App\User::getCurrentUserModel()->isAdmin() ? 'v' . \App\Version::get() : '';

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 '\App\Language' in method 'getPageTitle'.
Open

        $titleModal = \App\Language::translate('LBL_YETIFORCE_CRM_INFO');

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

Call to undeclared method \App\Controller\Components\View\YetiForceDetailModal::getViewer
Open

        $viewer = $this->getViewer($request);

Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

        $version = \App\User::getCurrentUserModel()->isAdmin() ? 'v' . \App\Version::get() : '';

Class extends undeclared class \App\Controller\Modal
Open

class YetiForceDetailModal extends \App\Controller\Modal

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

    }

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 true;

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 getPageTitle(\App\Request $request)

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

        return "YetiForceCRM {$version} - {$titleModal}";

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

    }

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

    public function process(\App\Request $request)

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

        $titleModal = \App\Language::translate('LBL_YETIFORCE_CRM_INFO');

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

    public $successBtn = '';

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

    {

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

        $version = \App\User::getCurrentUserModel()->isAdmin() ? 'v' . \App\Version::get() : '';

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

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

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

    public $modalSize = 'modal-xl';

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

    public $dangerBtn = 'LBL_CLOSE';

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

    public function checkPermission(\App\Request $request)

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

    {

There are no issues that match your filters.

Category
Status