@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Ffcms\Core\App; |
| 6 | 6 | use Ffcms\Core\Arch\Model; |
| 7 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 8 | 7 | use Ffcms\Core\Helper\Type\Str; |
| 9 | 8 | use Ffcms\Core\Interfaces\iUser; |
| 10 | 9 | |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | * Get single row by defined type and sys_name with query caching |
| 60 | 60 | * @param string $type |
| 61 | 61 | * @param string $sys_name |
| 62 | - * @return mixed|null |
|
| 62 | + * @return App |
|
| 63 | 63 | * @throws SyntaxException |
| 64 | 64 | */ |
| 65 | 65 | public static function getItem($type, $sys_name) |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | $scriptVersion = $this->getScriptVersion(); |
| 126 | 126 | |
| 127 | - return $scriptVersion === (float)$this->version; |
|
| 127 | + return $scriptVersion === (float) $this->version; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | return false; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - return (float)constant($class . '::VERSION'); |
|
| 145 | + return (float) constant($class . '::VERSION'); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | } |
| 149 | 149 | \ No newline at end of file |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $route = $app->sys_name . '/index'; |
| 30 | 30 | $icoStatus = null; |
| 31 | 31 | $actions = \App::$View->render('macro/app_actions', ['controller' => $app->sys_name]); |
| 32 | - if ((int)$app->disabled !== 0) { |
|
| 32 | + if ((int) $app->disabled !== 0) { |
|
| 33 | 33 | $icoStatus = ' <i class="fa fa-pause" style="color: #ff0000;"></i>'; |
| 34 | 34 | } elseif ($app->checkVersion() !== true) { |
| 35 | 35 | $icoStatus = ' <i class="fa fa-exclamation" style="color: #ffbd26;"></i>'; |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | - * Validation rules |
|
| 37 | - */ |
|
| 36 | + * Validation rules |
|
| 37 | + */ |
|
| 38 | 38 | public function rules() |
| 39 | 39 | { |
| 40 | 40 | return [ |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function before() |
| 40 | 40 | { |
| 41 | 41 | foreach ($this->_apps as $app) { |
| 42 | - $this->_definedControllers[] = (string)$app->sys_name; |
|
| 42 | + $this->_definedControllers[] = (string) $app->sys_name; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | parent::before(); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // get ext version |
| 80 | - $cVersion = (float)constant($cPath . '::VERSION'); |
|
| 80 | + $cVersion = (float) constant($cPath . '::VERSION'); |
|
| 81 | 81 | if ($cVersion < 0.1) { |
| 82 | 82 | $cVersion = 0.1; |
| 83 | 83 | } |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | parent::before(); |
| 28 | 28 | $configs = AppRecord::getConfigs('app', 'Content'); |
| 29 | 29 | // prevent null-type config data |
| 30 | - if ((int)$configs['gallerySize'] > 0) { |
|
| 31 | - $this->maxSize = (int)$configs['gallerySize'] * 1024; |
|
| 30 | + if ((int) $configs['gallerySize'] > 0) { |
|
| 31 | + $this->maxSize = (int) $configs['gallerySize'] * 1024; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if ((int)$configs['galleryResize'] > 0) { |
|
| 35 | - $this->maxResize = (int)$configs['galleryResize']; |
|
| 34 | + if ((int) $configs['galleryResize'] > 0) { |
|
| 35 | + $this->maxResize = (int) $configs['galleryResize']; |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | // check file size |
| 72 | 72 | if ($file->getSize() < 1 || $file->getSize() > $this->maxSize) { |
| 73 | - throw new JsonException(__('File size is too big. Max size: %size%kb', ['size' => intval($this->maxSize/1024)])); |
|
| 73 | + throw new JsonException(__('File size is too big. Max size: %size%kb', ['size' => intval($this->maxSize / 1024)])); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // check file extension |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | /** |
| 124 | 124 | * Get current extension active record |
| 125 | 125 | * @param string|null $type |
| 126 | - * @return mixed |
|
| 126 | + * @return AppRecord |
|
| 127 | 127 | */ |
| 128 | 128 | public function getTypeItem($type = null) |
| 129 | 129 | { |
@@ -139,7 +139,7 @@ |
||
| 139 | 139 | */ |
| 140 | 140 | public function getConfigs() |
| 141 | 141 | { |
| 142 | - return $this->type === 'widget' ? (array)Serialize::decode($this->widget->config) : (array)Serialize::decode($this->application->configs); |
|
| 142 | + return $this->type === 'widget' ? (array) Serialize::decode($this->widget->config) : (array) Serialize::decode($this->application->configs); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /** |
@@ -1,6 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -use Ffcms\Core\Helper\Date; |
|
| 4 | 3 | use Ffcms\Core\Helper\HTML\Form; |
| 5 | 4 | use Ffcms\Core\Helper\Type\Str; |
| 6 | 5 | use Ffcms\Core\Helper\Url; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $search = \Apps\ActiveRecord\App::getItem('app', $controller); |
| 72 | 72 | |
| 73 | 73 | // check what we got |
| 74 | - if ($search === null || (int)$search->id < 1) { |
|
| 74 | + if ($search === null || (int) $search->id < 1) { |
|
| 75 | 75 | throw new ForbiddenException('App is not founded'); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $search = \Apps\ActiveRecord\App::where('sys_name', '=', $controllerName)->where('type', '=', 'app')->first(); |
| 98 | 98 | |
| 99 | - if ($search === null || (int)$search->id < 1) { |
|
| 99 | + if ($search === null || (int) $search->id < 1) { |
|
| 100 | 100 | throw new ForbiddenException('App is not founded'); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $route = $widget->sys_name . '/index'; |
| 27 | 27 | $icoStatus = null; |
| 28 | 28 | $actions = $this->render('macro/widget_actions', ['controller' => $widget->sys_name]); |
| 29 | - if ((int)$widget->disabled !== 0) { |
|
| 29 | + if ((int) $widget->disabled !== 0) { |
|
| 30 | 30 | $icoStatus = ' <i class="fa fa-pause" style="color: #ff0000;"></i>'; |
| 31 | 31 | } elseif ($widget->checkVersion() !== true) { |
| 32 | 32 | $icoStatus = ' <i class="fa fa-exclamation" style="color: #ffbd26;"></i>'; |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Apps\ActiveRecord\App as AppRecord; |
| 6 | 6 | use Ffcms\Core\Arch\Model; |
| 7 | 7 | use Ffcms\Core\Exception\ForbiddenException; |
| 8 | -use Ffcms\Core\Exception\NativeException; |
|
| 9 | 8 | use Ffcms\Core\Exception\NotFoundException; |
| 10 | 9 | use Ffcms\Core\Helper\Date; |
| 11 | 10 | |
@@ -28,8 +28,8 @@ |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * Magic method before |
|
| 32 | - */ |
|
| 31 | + * Magic method before |
|
| 32 | + */ |
|
| 33 | 33 | public function before() |
| 34 | 34 | { |
| 35 | 35 | // get full name of update object |