@@ -198,7 +198,7 @@ |
||
| 198 | 198 | * Define a last of importer class with an array or run code directily with the import() method. |
| 199 | 199 | * |
| 200 | 200 | * @param ImportControllerInterface $importer |
| 201 | - * @return boolean|array |
|
| 201 | + * @return boolean |
|
| 202 | 202 | */ |
| 203 | 203 | public function import(ImportControllerInterface $importer) |
| 204 | 204 | { |
@@ -71,7 +71,6 @@ |
||
| 71 | 71 | * $this->addLog('block', 'new block <ID> have been found and added to database'); |
| 72 | 72 | * ``` |
| 73 | 73 | * |
| 74 | - * @param string $section |
|
| 75 | 74 | * @param string $value |
| 76 | 75 | * @todo trigger deprecated section call |
| 77 | 76 | */ |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | $this->verbosePrint('Run import index', __METHOD__); |
| 129 | 129 | foreach (Yii::$app->getModules() as $id => $module) { |
| 130 | 130 | if ($module instanceof \luya\base\Module) { |
| 131 | - $this->verbosePrint('collect module importers from module: ' . $id, __METHOD__); |
|
| 131 | + $this->verbosePrint('collect module importers from module: '.$id, __METHOD__); |
|
| 132 | 132 | $response = $module->import($this); |
| 133 | 133 | if (is_array($response)) { // importer returns an array with class names |
| 134 | 134 | foreach ($response as $class) { |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | ksort($queue); |
| 151 | 151 | |
| 152 | 152 | foreach ($queue as $pos => $object) { |
| 153 | - $this->verbosePrint("run object '" .$object->className() . " on pos $pos.", __METHOD__); |
|
| 153 | + $this->verbosePrint("run object '".$object->className()." on pos $pos.", __METHOD__); |
|
| 154 | 154 | $objectResponse = $object->run(); |
| 155 | - $this->verbosePrint("run object response: " . var_export($objectResponse, true), __METHOD__); |
|
| 155 | + $this->verbosePrint("run object response: ".var_export($objectResponse, true), __METHOD__); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | if (Yii::$app->hasModule('admin')) { |
@@ -160,15 +160,15 @@ discard block |
||
| 160 | 160 | Yii::$app->db->createCommand()->update('admin_user', ['force_reload' => 1])->execute(); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $this->verbosePrint('importer finished, get log output: ' . var_export($this->getLog(), true), __METHOD__); |
|
| 163 | + $this->verbosePrint('importer finished, get log output: '.var_export($this->getLog(), true), __METHOD__); |
|
| 164 | 164 | |
| 165 | 165 | foreach ($this->getLog() as $section => $value) { |
| 166 | - $this->outputInfo(PHP_EOL . $section . ":"); |
|
| 166 | + $this->outputInfo(PHP_EOL.$section.":"); |
|
| 167 | 167 | foreach ($value as $k => $v) { |
| 168 | 168 | if (is_array($v)) { |
| 169 | 169 | $this->output(print_r($v, true)); |
| 170 | 170 | } else { |
| 171 | - $this->output(" - " . $v); |
|
| 171 | + $this->output(" - ".$v); |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | } |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | { |
| 21 | 21 | if (is_numeric($string)) { |
| 22 | 22 | if (is_float($string)) { |
| 23 | - return (float)$string; |
|
| 23 | + return (float) $string; |
|
| 24 | 24 | } else { |
| 25 | - return (int)$string; |
|
| 25 | + return (int) $string; |
|
| 26 | 26 | } |
| 27 | 27 | } elseif (is_array($string)) { |
| 28 | 28 | return ArrayHelper::typeCast($string); |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $tests = [ |
| 3 | - "in_array('mod_rewrite', apache_get_modules());", |
|
| 4 | - "ini_get('short_open_tag');", |
|
| 5 | - "ini_get('error_reporting');", |
|
| 6 | - "phpversion()", |
|
| 7 | - "php_ini_loaded_file()", |
|
| 3 | + "in_array('mod_rewrite', apache_get_modules());", |
|
| 4 | + "ini_get('short_open_tag');", |
|
| 5 | + "ini_get('error_reporting');", |
|
| 6 | + "phpversion()", |
|
| 7 | + "php_ini_loaded_file()", |
|
| 8 | 8 | ]; |
| 9 | 9 | foreach ($tests as $i => $test) { |
| 10 | 10 | $result = eval('return ' . $test . ';'); |
@@ -7,6 +7,6 @@ |
||
| 7 | 7 | "php_ini_loaded_file()", |
| 8 | 8 | ]; |
| 9 | 9 | foreach ($tests as $i => $test) { |
| 10 | - $result = eval('return ' . $test . ';'); |
|
| 10 | + $result = eval('return '.$test.';'); |
|
| 11 | 11 | printf("%2d: [%s] %s<br />", $i + 1, $test, var_export($result, true)); |
| 12 | 12 | } |
| 13 | 13 | \ No newline at end of file |
@@ -217,12 +217,12 @@ |
||
| 217 | 217 | { |
| 218 | 218 | if ($this->renderEngine == 'php') { |
| 219 | 219 | $view = new View(); |
| 220 | - return $view->renderPhpFile(rtrim($this->getFolder(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . FileHelper::ensureExtension($file, 'php'), $args); |
|
| 220 | + return $view->renderPhpFile(rtrim($this->getFolder(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.FileHelper::ensureExtension($file, 'php'), $args); |
|
| 221 | 221 | } elseif ($this->renderEngine == 'twig') { |
| 222 | 222 | $twig = Yii::$app->twig->env(new Twig_Loader_Filesystem($this->getFolder())); |
| 223 | 223 | return $twig->render(FileHelper::ensureExtension($file, 'twig'), $args); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - throw new Exception('Not supported render engine: ' . $this->renderEngine); |
|
| 226 | + throw new Exception('Not supported render engine: '.$this->renderEngine); |
|
| 227 | 227 | } |
| 228 | 228 | } |
@@ -76,12 +76,12 @@ |
||
| 76 | 76 | if (isset($partial[0]) && (count($partial) > 1) && ($module = Yii::$app->getModule($partial[0]))) { |
| 77 | 77 | try { |
| 78 | 78 | // change the controller namespace of this module to make usage of `commands`. |
| 79 | - $module->controllerNamespace = $module->namespace . '\commands'; |
|
| 79 | + $module->controllerNamespace = $module->namespace.'\commands'; |
|
| 80 | 80 | unset($partial[0]); |
| 81 | 81 | // action response |
| 82 | 82 | return $module->runAction(implode("/", $partial), $params); |
| 83 | 83 | } catch (\Exception $e) { |
| 84 | - return Console::output("Command Exception: '" . $e->getMessage() . "' in file '" . $e->getFile() . "' on line '" . $e->getLine() . "'."); |
|
| 84 | + return Console::output("Command Exception: '".$e->getMessage()."' in file '".$e->getFile()."' on line '".$e->getLine()."'."); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -61,6 +61,11 @@ discard block |
||
| 61 | 61 | ]; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | + /** |
|
| 65 | + * @param string $type |
|
| 66 | + * @param string $varName |
|
| 67 | + * @param string $func |
|
| 68 | + */ |
|
| 64 | 69 | private function getExtraVarDef($type, $varName, $func) |
| 65 | 70 | { |
| 66 | 71 | $info = [ |
@@ -77,6 +82,9 @@ discard block |
||
| 77 | 82 | return false; |
| 78 | 83 | } |
| 79 | 84 | |
| 85 | + /** |
|
| 86 | + * @param string $type |
|
| 87 | + */ |
|
| 80 | 88 | private function getVariableTypeOption($type) |
| 81 | 89 | { |
| 82 | 90 | $types = $this->getVariableTypesOptions(); |
@@ -84,6 +92,9 @@ discard block |
||
| 84 | 92 | return $types[$type]; |
| 85 | 93 | } |
| 86 | 94 | |
| 95 | + /** |
|
| 96 | + * @param string $type |
|
| 97 | + */ |
|
| 87 | 98 | private function hasVariableTypeOption($type) |
| 88 | 99 | { |
| 89 | 100 | return array_key_exists($type, $this->getVariableTypesOptions()); |
@@ -92,7 +103,7 @@ discard block |
||
| 92 | 103 | /** |
| 93 | 104 | * Wizzard to create a new CMS block. |
| 94 | 105 | * |
| 95 | - * @return number |
|
| 106 | + * @return integer |
|
| 96 | 107 | */ |
| 97 | 108 | public function actionCreate() |
| 98 | 109 | { |
@@ -302,6 +313,9 @@ discard block |
||
| 302 | 313 | return $this->outputError("Error while creating file '$file'"); |
| 303 | 314 | } |
| 304 | 315 | |
| 316 | + /** |
|
| 317 | + * @param string $prefix |
|
| 318 | + */ |
|
| 305 | 319 | private function placeholderCreator($prefix) |
| 306 | 320 | { |
| 307 | 321 | $this->output(PHP_EOL.'-> Create new '.$prefix, Console::FG_YELLOW); |
@@ -320,8 +334,8 @@ discard block |
||
| 320 | 334 | |
| 321 | 335 | /** |
| 322 | 336 | * |
| 323 | - * @param unknown $prefix |
|
| 324 | - * @param string $type 'var', 'cfg' |
|
| 337 | + * @param string $prefix |
|
| 338 | + * @param string $typeCast |
|
| 325 | 339 | * @return multitype:string Ambigous <string, array> |
| 326 | 340 | */ |
| 327 | 341 | private function varCreator($prefix, $typeCast) |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | private function getExtraVarDef($type, $varName, $func) |
| 65 | 65 | { |
| 66 | 66 | $info = [ |
| 67 | - 'image-upload' => function ($varName) use ($func) { return '$this->zaaImageUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 68 | - 'image-array-upload' => function ($varName) use ($func) { return '$this->zaaImageArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 69 | - 'file-upload' => function ($varName) use ($func) { return '$this->zaaFileUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 70 | - 'file-array-upload' => function ($varName) use ($func) { return '$this->zaaFileArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 71 | - 'cms-page' => function ($varName) use ($func) { return 'Yii::$app->menu->findOne([\'nav_id\' => $this->'.$func.'(\''.$varName.'\', 0)]),'; }, |
|
| 67 | + 'image-upload' => function($varName) use ($func) { return '$this->zaaImageUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 68 | + 'image-array-upload' => function($varName) use ($func) { return '$this->zaaImageArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 69 | + 'file-upload' => function($varName) use ($func) { return '$this->zaaFileUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 70 | + 'file-array-upload' => function($varName) use ($func) { return '$this->zaaFileArrayUpload($this->'.$func.'(\''.$varName.'\')),'; }, |
|
| 71 | + 'cms-page' => function($varName) use ($func) { return 'Yii::$app->menu->findOne([\'nav_id\' => $this->'.$func.'(\''.$varName.'\', 0)]),'; }, |
|
| 72 | 72 | ]; |
| 73 | 73 | |
| 74 | 74 | if (array_key_exists($type, $info)) { |
@@ -186,15 +186,15 @@ discard block |
||
| 186 | 186 | $content .= ' * @var bool Choose whether block is a layout/container/segmnet/section block or not, Container elements will be optically displayed'.PHP_EOL; |
| 187 | 187 | $content .= ' * in a different way for a better user experience. Container block will not display isDirty colorizing.'.PHP_EOL; |
| 188 | 188 | $content .= ' */'.PHP_EOL; |
| 189 | - $content .= ' public $isContainer = false;'.PHP_EOL . PHP_EOL; |
|
| 189 | + $content .= ' public $isContainer = false;'.PHP_EOL.PHP_EOL; |
|
| 190 | 190 | $content .= ' /**'.PHP_EOL; |
| 191 | 191 | $content .= ' * @var bool Choose whether a block can be cached trough the caching component. Be carefull with caching container blocks.'.PHP_EOL; |
| 192 | 192 | $content .= ' */'.PHP_EOL; |
| 193 | - $content .= ' public $cacheEnabled = false;'.PHP_EOL . PHP_EOL; |
|
| 193 | + $content .= ' public $cacheEnabled = false;'.PHP_EOL.PHP_EOL; |
|
| 194 | 194 | $content .= ' /**'.PHP_EOL; |
| 195 | 195 | $content .= ' * @var int The cache lifetime for this block in seconds (3600 = 1 hour), only affects when cacheEnabled is true'.PHP_EOL; |
| 196 | 196 | $content .= ' */'.PHP_EOL; |
| 197 | - $content .= ' public $cacheExpiration = 3600;'.PHP_EOL . PHP_EOL; |
|
| 197 | + $content .= ' public $cacheExpiration = 3600;'.PHP_EOL.PHP_EOL; |
|
| 198 | 198 | |
| 199 | 199 | // method name |
| 200 | 200 | $content .= ' public function name()'.PHP_EOL; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | /** |
| 17 | 17 | * Create a new frontend/admin module. |
| 18 | 18 | * |
| 19 | - * @return number |
|
| 19 | + * @return integer |
|
| 20 | 20 | */ |
| 21 | 21 | public function actionCreate() |
| 22 | 22 | { |