@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | if ($route === $composition) { |
49 | 49 | $parsedRequest[0] = false; |
50 | 50 | // now see if the composition (+1 as we add add trailing slash at the end) matches the cutted route request part, if so its composition prefix, remove it. |
51 | - } elseif (substr($route, 0, $length+1) == $composition.'/') { |
|
51 | + } elseif (substr($route, 0, $length + 1) == $composition.'/') { |
|
52 | 52 | $parsedRequest[0] = substr($parsedRequest[0], $length); |
53 | 53 | } |
54 | 54 | // fix broken request urls |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | $params = (array) $params; |
212 | 212 | $url = $this->internalCreateUrl($params); |
213 | 213 | if (strpos($url, '://') === false) { |
214 | - $url = $this->getHostInfo() . $url; |
|
214 | + $url = $this->getHostInfo().$url; |
|
215 | 215 | } |
216 | 216 | if (is_string($scheme) && ($pos = strpos($url, '://')) !== false) { |
217 | - $url = $scheme . substr($url, $pos); |
|
217 | + $url = $scheme.substr($url, $pos); |
|
218 | 218 | } |
219 | 219 | return $url; |
220 | 220 | } |
@@ -30,38 +30,38 @@ discard block |
||
30 | 30 | public function getFunctions() |
31 | 31 | { |
32 | 32 | return [ |
33 | - 'menuFindAll' => function ($container, $parentNavId) { |
|
33 | + 'menuFindAll' => function($container, $parentNavId) { |
|
34 | 34 | return Yii::$app->menu->findAll(['container' => $container, 'parent_nav_id' => $parentNavId]); |
35 | 35 | }, |
36 | - 'menuFindOne' => function ($id) { |
|
36 | + 'menuFindOne' => function($id) { |
|
37 | 37 | return Yii::$app->menu->findOne(['id' => $id]); |
38 | 38 | }, |
39 | - 'menuCurrent' => function () { |
|
39 | + 'menuCurrent' => function() { |
|
40 | 40 | return Yii::$app->menu->current; |
41 | 41 | }, |
42 | - 'menuCurrentLevel' => function ($level) { |
|
42 | + 'menuCurrentLevel' => function($level) { |
|
43 | 43 | return Yii::$app->menu->getLevelCurrent($level); |
44 | 44 | }, |
45 | - 'menuLevelContainer' => function ($level) { |
|
45 | + 'menuLevelContainer' => function($level) { |
|
46 | 46 | return Yii::$app->menu->getLevelContainer($level); |
47 | 47 | }, |
48 | - 'asset' => function ($name) { |
|
48 | + 'asset' => function($name) { |
|
49 | 49 | return Yii::$app->getAssetManager()->getBundle($name); |
50 | 50 | }, |
51 | - 'filterApply' => function ($imageId, $filterIdentifier) { |
|
51 | + 'filterApply' => function($imageId, $filterIdentifier) { |
|
52 | 52 | return Yii::$app->storage->getImage($imageId)->applyFilter($filterIdentifier); |
53 | 53 | }, |
54 | - 'image' => function ($imageId) { |
|
54 | + 'image' => function($imageId) { |
|
55 | 55 | return Yii::$app->storage->getImage($imageId); |
56 | 56 | }, |
57 | - 'element' => function () { |
|
57 | + 'element' => function() { |
|
58 | 58 | $args = func_get_args(); |
59 | 59 | $method = $args[0]; |
60 | 60 | unset($args[0]); |
61 | 61 | |
62 | 62 | return Yii::$app->element->run($method, $args); |
63 | 63 | }, |
64 | - 't' => function () { |
|
64 | + 't' => function() { |
|
65 | 65 | $args = func_get_args(); |
66 | 66 | |
67 | 67 | return call_user_func_array(['Yii', 't'], $args); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $twig->addFunction(new Twig_SimpleFunction($name, $lambda)); |
80 | 80 | } |
81 | 81 | |
82 | - $twig->addFilter(new Twig_SimpleFilter('strftime', function ($timestamp, $format) { |
|
82 | + $twig->addFilter(new Twig_SimpleFilter('strftime', function($timestamp, $format) { |
|
83 | 83 | if (is_numeric($timestamp)) { |
84 | 84 | return strftime($format, $timestamp); |
85 | 85 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | $name = substr($name, 0, -(strlen($suffix))); |
76 | 76 | } |
77 | 77 | |
78 | - return $name . $suffix; |
|
78 | + return $name.$suffix; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | |
54 | 54 | protected function createMigration($class) |
55 | 55 | { |
56 | - $orig = $this->migrationPath . DIRECTORY_SEPARATOR . $class . '.php'; |
|
56 | + $orig = $this->migrationPath.DIRECTORY_SEPARATOR.$class.'.php'; |
|
57 | 57 | |
58 | 58 | if (file_exists($orig)) { |
59 | 59 | require_once $file; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $module = $this->prompt("Could not find migration class. Please enter the module name who belongs to '$class.':"); |
73 | 73 | $dir = $this->getModuleMigrationDirectorie($module); |
74 | - $file = $dir . DIRECTORY_SEPARATOR . $class . '.php'; |
|
74 | + $file = $dir.DIRECTORY_SEPARATOR.$class.'.php'; |
|
75 | 75 | if (file_exists($file)) { |
76 | 76 | require_once $file; |
77 | 77 | return new $class(); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | @chdir(Yii::getAlias('@app')); |
38 | 38 | |
39 | - $this->output('The directory the health commands is applying to: ' . Yii::getAlias('@app')); |
|
39 | + $this->output('The directory the health commands is applying to: '.Yii::getAlias('@app')); |
|
40 | 40 | |
41 | 41 | foreach ($this->folders as $folder => $writable) { |
42 | 42 | if (!file_exists($folder)) { |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | private function getExtraVarDef($type, $varName, $func) |
60 | 60 | { |
61 | 61 | $info = [ |
62 | - 'image-upload' => function ($varName) use ($func) { return '$this->zaaImageUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
63 | - 'image-array-upload' => function ($varName) use ($func) { return '$this->zaaImageArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
64 | - 'file-upload' => function ($varName) use ($func) { return '$this->zaaFileUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
65 | - 'file-array-upload' => function ($varName) use ($func) { return '$this->zaaFileArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
62 | + 'image-upload' => function($varName) use ($func) { return '$this->zaaImageUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
63 | + 'image-array-upload' => function($varName) use ($func) { return '$this->zaaImageArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
64 | + 'file-upload' => function($varName) use ($func) { return '$this->zaaFileUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
65 | + 'file-array-upload' => function($varName) use ($func) { return '$this->zaaFileArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
66 | 66 | ]; |
67 | 67 | |
68 | 68 | if (array_key_exists($type, $info)) { |
@@ -174,15 +174,15 @@ discard block |
||
174 | 174 | $content .= ' * @var bool Choose whether block is a layout/container/segmnet/section block or not, Container elements will be optically displayed'.PHP_EOL; |
175 | 175 | $content .= ' * in a different way for a better user experience. Container block will not display isDirty colorizing.'.PHP_EOL; |
176 | 176 | $content .= ' */'.PHP_EOL; |
177 | - $content .= ' public $isContainer = false;'.PHP_EOL . PHP_EOL; |
|
177 | + $content .= ' public $isContainer = false;'.PHP_EOL.PHP_EOL; |
|
178 | 178 | $content .= ' /**'.PHP_EOL; |
179 | 179 | $content .= ' * @var bool Choose whether a block can be cached trough the caching component. Be carefull with caching container blocks.'.PHP_EOL; |
180 | 180 | $content .= ' */'.PHP_EOL; |
181 | - $content .= ' public $cacheEnabled = false;'.PHP_EOL . PHP_EOL; |
|
181 | + $content .= ' public $cacheEnabled = false;'.PHP_EOL.PHP_EOL; |
|
182 | 182 | $content .= ' /**'.PHP_EOL; |
183 | 183 | $content .= ' * @var int The cache lifetime for this block in seconds (3600 = 1 hour), only affects when cacheEnabled is true'.PHP_EOL; |
184 | 184 | $content .= ' */'.PHP_EOL; |
185 | - $content .= ' public $cacheExpiration = 3600;'.PHP_EOL . PHP_EOL; |
|
185 | + $content .= ' public $cacheExpiration = 3600;'.PHP_EOL.PHP_EOL; |
|
186 | 186 | |
187 | 187 | // method name |
188 | 188 | $content .= ' public function name()'.PHP_EOL; |
@@ -25,21 +25,21 @@ |
||
25 | 25 | |
26 | 26 | if (count($fileList) !== 0) { |
27 | 27 | $success = true; |
28 | - if ($this->confirm("Do you want to delete " . count($fileList) . " files which are not referenced in the database any more?")) { |
|
28 | + if ($this->confirm("Do you want to delete ".count($fileList)." files which are not referenced in the database any more?")) { |
|
29 | 29 | foreach ($fileList as $file) { |
30 | 30 | if (is_file($file) && @unlink($file)) { |
31 | - $this->outputSuccess($file . " successful deleted."); |
|
31 | + $this->outputSuccess($file." successful deleted."); |
|
32 | 32 | } elseif (is_file($file)) { |
33 | - $this->outputError($file . " could not be deleted!"); |
|
33 | + $this->outputError($file." could not be deleted!"); |
|
34 | 34 | $success = false; |
35 | 35 | } else { |
36 | - $this->outputError($file . " could not be found!"); |
|
36 | + $this->outputError($file." could not be found!"); |
|
37 | 37 | $success = false; |
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
41 | 41 | if ($success) { |
42 | - return $this->outputSuccess(count($fileList) . " files successful deleted."); |
|
42 | + return $this->outputSuccess(count($fileList)." files successful deleted."); |
|
43 | 43 | } |
44 | 44 | return $this->outputError("Cleanup could not be completed. Please look into error above."); |
45 | 45 | } |
@@ -31,13 +31,13 @@ |
||
31 | 31 | |
32 | 32 | $module = Yii::$app->getModule($moduleId); |
33 | 33 | |
34 | - $folder = $module->basePath . DIRECTORY_SEPARATOR . 'aws'; |
|
34 | + $folder = $module->basePath.DIRECTORY_SEPARATOR.'aws'; |
|
35 | 35 | |
36 | - $file = $folder . DIRECTORY_SEPARATOR . $className . '.php'; |
|
36 | + $file = $folder.DIRECTORY_SEPARATOR.$className.'.php'; |
|
37 | 37 | |
38 | 38 | $content = $this->view->render('@luya/console/commands/views/aw/create.php', [ |
39 | 39 | 'className' => $className, |
40 | - 'namespace' => $module->getNamespace() . '\\aws', |
|
40 | + 'namespace' => $module->getNamespace().'\\aws', |
|
41 | 41 | 'luya' => $this->getLuyaVersion(), |
42 | 42 | 'moduleId' => $moduleId, |
43 | 43 | 'alias' => Inflector::humanize(Inflector::camel2words($className)), |
@@ -11,6 +11,6 @@ |
||
11 | 11 | { |
12 | 12 | $class = new ReflectionClass($this); |
13 | 13 | |
14 | - return '@app/views/widgets/' . Inflector::camel2id($class->getShortName()); |
|
14 | + return '@app/views/widgets/'.Inflector::camel2id($class->getShortName()); |
|
15 | 15 | } |
16 | 16 | } |