YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

        $viewer->assign('IMAGES', \App\Layout\Media::getImages());

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_Vtiger_Module_Model' in method 'process'.
Open

            $moduleModel = \Settings_Vtiger_Module_Model::getInstance('Settings:Media');

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\Layout\Icon' in method 'process'.
Open

        $viewer->assign('ICONS', \App\Layout\Icon::getIcons());

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\Security\AdminAccess' in method 'process'.
Open

        if (\App\Security\AdminAccess::isPermitted('Media')) {

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

Class extends undeclared class \App\Controller\Modal
Open

class MediaModal extends \App\Controller\Modal

Call to undeclared method \Settings_Vtiger_Module_Model::getFieldInstanceByName
Open

            $fieldModel = $moduleModel->getFieldInstanceByName('image');

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

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

Reference to undeclared class \App\Controller\Modal
Open

        return array_merge(parent::getModalScripts($request), $this->checkAndConvertJsScripts([

Call to undeclared method \App\Controller\Components\View\MediaModal::checkAndConvertJsScripts
Open

        return array_merge(parent::getModalScripts($request), $this->checkAndConvertJsScripts([

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

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

    public $modalSize = 'c-modal-xxl';

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->assign('IMAGES', \App\Layout\Media::getImages());

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

        if (\App\Security\AdminAccess::isPermitted('Media')) {

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

        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

        ]));

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

        }

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

    protected $pageTitle = 'LBL_MEDIA';

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

        $viewer->assign('ICONS', \App\Layout\Icon::getIcons());

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

        $viewer->assign('PAGE_LIMT', 100);

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

    public $modalIcon = 'fas fa-icons';

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

            $moduleModel = \Settings_Vtiger_Module_Model::getInstance('Settings:Media');

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

            $viewer->assign('FIELD_MODEL', $fieldModel);

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

        return array_merge(parent::getModalScripts($request), $this->checkAndConvertJsScripts([

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

            $fieldModel = $moduleModel->getFieldInstanceByName('image');

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

    /** {@inheritdoc} */

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

    public function getModalScripts(\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

            'components.MediaModal',

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

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

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

    }

There are no issues that match your filters.

Category
Status