@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * BootManager constructor. Pass composer loader inside |
| 29 | - * @param bool|object $loader |
|
| 29 | + * @param boolean $loader |
|
| 30 | 30 | */ |
| 31 | 31 | public function __construct($loader = false) |
| 32 | 32 | { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | // check if cache is enabled |
| 43 | 43 | if (App::$Cache !== null) { |
| 44 | 44 | // try to get bootable class map from cache, or initialize parsing |
| 45 | - $cache = App::$Cache->getItem('boot.' . env_name . '.class.map'); |
|
| 45 | + $cache = App::$Cache->getItem('boot.'.env_name.'.class.map'); |
|
| 46 | 46 | if (!$cache->isHit()) { |
| 47 | 47 | $this->compileBootableClasses(); |
| 48 | 48 | $cache->set($this->objects)->expiresAfter(static::CACHE_TREE_TIME); |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | // list app root's |
| 99 | 99 | foreach ($this->appRoots as $app) { |
| 100 | - $app .= '/Apps/Controller/' . env_name; |
|
| 100 | + $app .= '/Apps/Controller/'.env_name; |
|
| 101 | 101 | $files = File::listFiles($app, ['.php'], true); |
| 102 | 102 | foreach ($files as $file) { |
| 103 | 103 | // define full class name with namespace |
| 104 | - $class = 'Apps\Controller\\' . env_name . '\\' . Str::cleanExtension($file); |
|
| 104 | + $class = 'Apps\Controller\\'.env_name.'\\'.Str::cleanExtension($file); |
|
| 105 | 105 | // check if class exists (must be loaded over autoloader), boot method exist and this is controller instanceof |
| 106 | 106 | if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Controller', true)) { |
| 107 | 107 | $this->objects[] = $class; |
@@ -111,14 +111,14 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | // list widget root's |
| 113 | 113 | foreach ($this->widgetRoots as $widget) { |
| 114 | - $widget .= '/Widgets/' . env_name; |
|
| 114 | + $widget .= '/Widgets/'.env_name; |
|
| 115 | 115 | // widgets are packed in directory, classname should be the same with root directory name |
| 116 | 116 | $dirs = Directory::scan($widget, GLOB_ONLYDIR, true); |
| 117 | 117 | if (!Obj::isArray($dirs)) { |
| 118 | 118 | continue; |
| 119 | 119 | } |
| 120 | 120 | foreach ($dirs as $instance) { |
| 121 | - $class = 'Widgets\\' . env_name . '\\' . $instance . '\\' . $instance; |
|
| 121 | + $class = 'Widgets\\'.env_name.'\\'.$instance.'\\'.$instance; |
|
| 122 | 122 | if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Widget', true)) { |
| 123 | 123 | $this->objects[] = $class; |
| 124 | 124 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // check if options is defined |
| 45 | 45 | $options = $this->properties['options']; |
| 46 | 46 | if (!Obj::isIterable($options)) { |
| 47 | - throw new SyntaxException('Options for field ' . self::nohtml($this->name) . ' is not iterable'); |
|
| 47 | + throw new SyntaxException('Options for field '.self::nohtml($this->name).' is not iterable'); |
|
| 48 | 48 | } |
| 49 | 49 | unset($this->properties['options']); |
| 50 | 50 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $this->properties['value'] = $opt; |
| 66 | 66 | // apply structured checkboxes style for each item |
| 67 | 67 | $build .= App::$View->render('native/form/multi_checkboxes_list', [ |
| 68 | - 'item' => self::buildSingleTag('input', $this->properties) . self::nohtml($opt) |
|
| 68 | + 'item' => self::buildSingleTag('input', $this->properties).self::nohtml($opt) |
|
| 69 | 69 | ]); |
| 70 | 70 | } |
| 71 | 71 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | // get options from properties |
| 42 | 42 | $options = $this->properties['options']; |
| 43 | 43 | if (!Obj::isIterable($options)) { |
| 44 | - throw new SyntaxException('Radio field ' . self::nohtml($this->name) . ' have no iterable options'); |
|
| 44 | + throw new SyntaxException('Radio field '.self::nohtml($this->name).' have no iterable options'); |
|
| 45 | 45 | } |
| 46 | 46 | unset($this->properties['options'], $this->properties['value']); |
| 47 | 47 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $options = $this->properties['options']; |
| 37 | 37 | $optionsKey = (bool)$this->properties['optionsKey']; |
| 38 | 38 | if (!Obj::isIterable($options)) { |
| 39 | - throw new SyntaxException('Options for field ' . self::nohtml($this->name) . ' is not iterable'); |
|
| 39 | + throw new SyntaxException('Options for field '.self::nohtml($this->name).' is not iterable'); |
|
| 40 | 40 | } |
| 41 | 41 | unset($this->properties['options']); |
| 42 | 42 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $options = $this->properties['options']; |
| 36 | 36 | unset($this->properties['options']); |
| 37 | 37 | if (!Obj::isIterable($options)) { |
| 38 | - throw new SyntaxException('Select field ' . self::nohtml($this->name) . ' have no iterable options'); |
|
| 38 | + throw new SyntaxException('Select field '.self::nohtml($this->name).' have no iterable options'); |
|
| 39 | 39 | } |
| 40 | 40 | // value is not used there |
| 41 | 41 | unset($this->properties['value']); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | // check if class exist |
| 27 | 27 | if (!class_exists(self::$class)) { |
| 28 | - return 'Error: Widget is not founded: ' . self::$class; |
|
| 28 | + return 'Error: Widget is not founded: '.self::$class; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // init class and pass properties |
@@ -210,7 +210,7 @@ |
||
| 210 | 210 | /** |
| 211 | 211 | * Get file md5 hash |
| 212 | 212 | * @param string $path |
| 213 | - * @return bool|string |
|
| 213 | + * @return false|string |
|
| 214 | 214 | */ |
| 215 | 215 | public static function getMd5($path) |
| 216 | 216 | { |
@@ -192,15 +192,15 @@ |
||
| 192 | 192 | return []; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - $dir = opendir($path . '/.'); |
|
| 195 | + $dir = opendir($path.'/.'); |
|
| 196 | 196 | while ($item = readdir($dir)) { |
| 197 | - if (is_file($sub = $path . '/' . $item)) { |
|
| 197 | + if (is_file($sub = $path.'/'.$item)) { |
|
| 198 | 198 | $item_ext = Str::lastIn($item, '.'); |
| 199 | 199 | if ($ext === null || Arr::in($item_ext, $ext)) { |
| 200 | 200 | if ($returnRelative) { |
| 201 | 201 | $files[] = $item; |
| 202 | 202 | } else { |
| 203 | - $files[] = $path . DIRECTORY_SEPARATOR . $item; |
|
| 203 | + $files[] = $path.DIRECTORY_SEPARATOR.$item; |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | } else { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | continue; |
| 73 | 73 | } |
| 74 | 74 | // check initialize conditions (equals to $exist) |
| 75 | - if (File::exist($this->dir . '/' . $migration)) { |
|
| 75 | + if (File::exist($this->dir.'/'.$migration)) { |
|
| 76 | 76 | if (Arr::in($fullName, $dbmigrations) === $exist) { |
| 77 | 77 | $found[] = $migration; |
| 78 | 78 | } |
@@ -102,17 +102,17 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // check if migration file is exists |
| 105 | - if (!File::exist($this->dir . '/' . $file)) { |
|
| 105 | + if (!File::exist($this->dir.'/'.$file)) { |
|
| 106 | 106 | return false; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // check if migration file located in extend directory and copy to default |
| 110 | 110 | if (Normalize::diskFullPath($this->dir) !== Normalize::diskFullPath(static::DEFAULT_DIR)) { |
| 111 | - File::copy($this->dir . DIRECTORY_SEPARATOR . $file, static::DEFAULT_DIR . DIRECTORY_SEPARATOR . $file); |
|
| 111 | + File::copy($this->dir.DIRECTORY_SEPARATOR.$file, static::DEFAULT_DIR.DIRECTORY_SEPARATOR.$file); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // include migration and get class name |
| 115 | - File::inc($this->dir . '/' . $file, false, false); |
|
| 115 | + File::inc($this->dir.'/'.$file, false, false); |
|
| 116 | 116 | $fullName = Str::cleanExtension($file); |
| 117 | 117 | $class = Str::firstIn($fullName, '-'); |
| 118 | 118 | |
@@ -148,11 +148,11 @@ discard block |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // check if exists |
| 151 | - if (!File::exist($this->dir . '/' . $file)) { |
|
| 151 | + if (!File::exist($this->dir.'/'.$file)) { |
|
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - File::inc($this->dir . '/' . $file, false, false); |
|
| 155 | + File::inc($this->dir.'/'.$file, false, false); |
|
| 156 | 156 | $fullName = Str::cleanExtension($file); |
| 157 | 157 | $class = Str::firstIn($fullName, '-'); |
| 158 | 158 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | // check if properties is passed well |
| 47 | 47 | if ($properties !== null && !Obj::isArray($properties)) { |
| 48 | - throw new SyntaxException('Property must be passed as array or null! Field: ' . $name); |
|
| 48 | + throw new SyntaxException('Property must be passed as array or null! Field: '.$name); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | // add properties to autovalidation by js (properties passed by ref) |
@@ -98,9 +98,9 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | // if field is unknown type add notification in debugbar |
| 100 | 100 | if (App::$Debug !== null) { |
| 101 | - App::$Debug->addMessage('Field with name [' . App::$Security->strip_tags($name) . '] have unknown type [' . $this->type . ']', 'error'); |
|
| 101 | + App::$Debug->addMessage('Field with name ['.App::$Security->strip_tags($name).'] have unknown type ['.$this->type.']', 'error'); |
|
| 102 | 102 | } |
| 103 | - return 'No data: ' . App::$Security->strip_tags($name); |
|
| 103 | + return 'No data: '.App::$Security->strip_tags($name); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -147,12 +147,12 @@ discard block |
||
| 147 | 147 | if (Str::contains('.', $name)) { |
| 148 | 148 | $splitedName = explode('.', $name); |
| 149 | 149 | foreach ($splitedName as $nameKey) { |
| 150 | - $properties['name'] .= '[' . $nameKey . ']'; |
|
| 151 | - $properties['id'] .= '-' . $nameKey; |
|
| 150 | + $properties['name'] .= '['.$nameKey.']'; |
|
| 151 | + $properties['id'] .= '-'.$nameKey; |
|
| 152 | 152 | } |
| 153 | 153 | } else { // standard property definition - add field name |
| 154 | - $properties['name'] .= '[' . $name . ']'; |
|
| 155 | - $properties['id'] .= '-' . $name; |
|
| 154 | + $properties['name'] .= '['.$name.']'; |
|
| 155 | + $properties['id'] .= '-'.$name; |
|
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | } |
| 159 | 159 | \ No newline at end of file |