@@ -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 |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | } elseif (method_exists($class, $obj)) { // maybe its a function? |
| 140 | 140 | $class = $class::$obj; // call function |
| 141 | 141 | } else { |
| 142 | - throw new SyntaxException('Filter callback execution failed: ' . $filterName); |
|
| 142 | + throw new SyntaxException('Filter callback execution failed: '.$filterName); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if (method_exists($class, $method)) { |
| 149 | 149 | $check = @$class::$method($fieldValue, $filterArgs); |
| 150 | 150 | } else { |
| 151 | - throw new SyntaxException('Filter callback execution failed: ' . $filterName); |
|
| 151 | + throw new SyntaxException('Filter callback execution failed: '.$filterName); |
|
| 152 | 152 | } |
| 153 | 153 | } elseif (method_exists('Ffcms\Core\Helper\ModelFilters', $filterName)) { // only full namespace\class path based :( |
| 154 | 154 | if ($filterArgs != null) { |
@@ -157,14 +157,14 @@ discard block |
||
| 157 | 157 | $check = ModelFilters::$filterName($fieldValue); |
| 158 | 158 | } |
| 159 | 159 | } else { |
| 160 | - throw new SyntaxException('Filter "' . $filterName . '" is not exist'); |
|
| 160 | + throw new SyntaxException('Filter "'.$filterName.'" is not exist'); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // if one from all validation tests is fail - mark as incorrect attribute |
| 164 | 164 | if ($check !== true) { |
| 165 | 165 | $this->_badAttr[] = $propertyName; |
| 166 | 166 | if (App::$Debug) { |
| 167 | - App::$Debug->addMessage('Validation failed. Property: ' . $propertyName . ', filter: ' . $filterName, 'warning'); |
|
| 167 | + App::$Debug->addMessage('Validation failed. Property: '.$propertyName.', filter: '.$filterName, 'warning'); |
|
| 168 | 168 | } |
| 169 | 169 | } else { |
| 170 | 170 | $field_set_name = $propertyName; |
@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // try to load from file |
| 45 | - $configFile = ucfirst(Str::lowerCase($configName)) . '.php'; |
|
| 46 | - if (File::exist('/Private/Config/' . $configFile)) { |
|
| 47 | - $this->data[$configName] = File::inc('/Private/Config/' . $configFile, true); |
|
| 45 | + $configFile = ucfirst(Str::lowerCase($configName)).'.php'; |
|
| 46 | + if (File::exist('/Private/Config/'.$configFile)) { |
|
| 47 | + $this->data[$configName] = File::inc('/Private/Config/'.$configFile, true); |
|
| 48 | 48 | return true; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | public function writeConfig(string $configFile, array $data): bool |
| 139 | 139 | { |
| 140 | - $path = '/Private/Config/' . ucfirst(Str::lowerCase($configFile)) . '.php'; |
|
| 140 | + $path = '/Private/Config/'.ucfirst(Str::lowerCase($configFile)).'.php'; |
|
| 141 | 141 | if (!File::exist($path) || !File::writable($path)) { |
| 142 | 142 | return false; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $saveData = '<?php return ' . Arr::exportVar($data) . ';'; |
|
| 145 | + $saveData = '<?php return '.Arr::exportVar($data).';'; |
|
| 146 | 146 | File::write($path, $saveData); |
| 147 | 147 | // overload config values if changed |
| 148 | 148 | $this->load($configFile, true); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | if (Any::isArray($params) && count($params) > 0) { |
| 57 | 57 | foreach ($params as $var => $value) { |
| 58 | - $text = Str::replace('%' . $var . '%', $value, $text); |
|
| 58 | + $text = Str::replace('%'.$var.'%', $value, $text); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | return $text; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public function translate(string $text, array $params = null) |
| 71 | 71 | { |
| 72 | 72 | $index = null; |
| 73 | - $namespace = 'Apps\Controller\\' . env_name . '\\'; |
|
| 73 | + $namespace = 'Apps\Controller\\'.env_name.'\\'; |
|
| 74 | 74 | foreach (@debug_backtrace() as $caller) { |
| 75 | 75 | if (isset($caller['class']) && Str::startsWith($namespace, $caller['class'])) { |
| 76 | 76 | $index = Str::sub((string)$caller['class'], Str::length($namespace)); |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | protected function load(string $index): ?array |
| 88 | 88 | { |
| 89 | - $file = root . '/I18n/' . env_name . '/' . App::$Request->getLanguage() . '/' . $index . '.php'; |
|
| 89 | + $file = root.'/I18n/'.env_name.'/'.App::$Request->getLanguage().'/'.$index.'.php'; |
|
| 90 | 90 | if (!File::exist($file)) { |
| 91 | 91 | return []; |
| 92 | 92 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | public function getAvailableLangs(): array |
| 126 | 126 | { |
| 127 | 127 | $langs = ['en']; |
| 128 | - $scan = Directory::scan(root . '/I18n/' . env_name . '/', GLOB_ONLYDIR, true); |
|
| 128 | + $scan = Directory::scan(root.'/I18n/'.env_name.'/', GLOB_ONLYDIR, true); |
|
| 129 | 129 | foreach ($scan as $row) { |
| 130 | 130 | $langs[] = trim($row, '/'); |
| 131 | 131 | } |
@@ -66,6 +66,6 @@ |
||
| 66 | 66 | return 'error'; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - return (int)$load . '%'; |
|
| 69 | + return (int)$load.'%'; |
|
| 70 | 70 | } |
| 71 | 71 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | } catch (\Exception $e) { |
| 85 | 85 | if (App::$Debug) { |
| 86 | 86 | App::$Debug->addException($e); |
| 87 | - App::$Debug->addMessage('Send mail failed! Info: ' . $e->getMessage(), 'error'); |
|
| 87 | + App::$Debug->addMessage('Send mail failed! Info: '.$e->getMessage(), 'error'); |
|
| 88 | 88 | } |
| 89 | 89 | return false; |
| 90 | 90 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | return false; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $callback = (string)$class . '::' . (string)$method; |
|
| 79 | + $callback = (string)$class.'::'.(string)$method; |
|
| 80 | 80 | |
| 81 | 81 | // add instance to cron task manager |
| 82 | 82 | if (!isset($this->configs['instances'][$callback])) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function remove($class, $method) |
| 96 | 96 | { |
| 97 | - $callback = $class . '::' . $method; |
|
| 97 | + $callback = $class.'::'.$method; |
|
| 98 | 98 | if (isset($this->configs['instances'][$callback])) { |
| 99 | 99 | unset($this->configs['instances'][$callback], $this->configs['log'][$callback]); |
| 100 | 100 | App::$Properties->writeConfig('Cron', $this->configs); |
@@ -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,7 +111,7 @@ 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 (!Any::isArray($dirs)) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | foreach ($dirs as $instance) { |
| 122 | - $class = 'Widgets\\' . env_name . '\\' . $instance . '\\' . $instance; |
|
| 122 | + $class = 'Widgets\\'.env_name.'\\'.$instance.'\\'.$instance; |
|
| 123 | 123 | if (class_exists($class) && method_exists($class, 'boot') && is_a($class, 'Ffcms\Core\Arch\Widget', true)) { |
| 124 | 124 | $this->objects[] = $class; |
| 125 | 125 | } |
@@ -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 | |