Issues (1519)

system/modules/Ui/Ui.php (4 issues)

1
<?php
2
3
namespace Inji;
4
/**
5
 * Ui module
6
 *
7
 * @author Alexey Krupskiy <[email protected]>
8
 * @link http://inji.ru/
9
 * @copyright 2015 Alexey Krupskiy
10
 * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
11
 */
12
class Ui extends Module {
13
    public $name = 'Ui';
14
15
    public function init() {
16
        $this->app->view->customAsset('js', ['file' => '/static/moduleAsset/Ui/js/Ui.js']);
0 ignored issues
show
Bug Best Practice introduced by
The property view does not exist on Inji\App. Since you implemented __get, consider adding a @property annotation.
Loading history...
The method customAsset() does not exist on Inji\Module. It seems like you code against a sub-type of Inji\Module such as Inji\Db. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
        $this->app->view->/** @scrutinizer ignore-call */ 
17
                          customAsset('js', ['file' => '/static/moduleAsset/Ui/js/Ui.js']);
Loading history...
The method customAsset() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
        $this->app->view->/** @scrutinizer ignore-call */ 
17
                          customAsset('js', ['file' => '/static/moduleAsset/Ui/js/Ui.js']);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17
        $this->app->view->customAsset('js', ['file' => '/static/moduleAsset/Ui/js/DataManager.js']);
18
        if ((!$this->app->users || \Inji\Users\User::$cur->isAdmin()) && $this->app->type == 'app') {
0 ignored issues
show
Bug Best Practice introduced by
The property users does not exist on Inji\App. Since you implemented __get, consider adding a @property annotation.
Loading history...
19
            $this->app->view->customAsset('js', ['file' => '/static/moduleAsset/Ui/js/fastEdit.js', 'name' => 'Ui', 'libs' => ['ckeditor']]);
20
        }
21
        $this->app->view->customAsset('css', '/static/moduleAsset/Ui/css/Ui.css');
22
    }
23
24
    public function getModelForm($modelName, $formName = '') {
25
        if (!$formName) {
26
            $formName = 'manager';
27
        }
28
        return class_exists($modelName) && !empty($modelName::$forms[$formName]) ? $modelName::$forms[$formName] : [];
29
    }
30
31
}
32