@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * NgRest Model created at <?= date("d.m.Y H:i"); ?> on LUYA Version <?= $luyaVersion; ?>. |
24 | 24 | * |
25 | -<?php foreach ($properties as $name => $type): ?> * @property <?= $type; ?> $<?= $name . PHP_EOL; ?> |
|
26 | -<?php endforeach;?> |
|
25 | +<?php foreach ($properties as $name => $type): ?> * @property <?= $type; ?> $<?= $name.PHP_EOL; ?> |
|
26 | +<?php endforeach; ?> |
|
27 | 27 | */ |
28 | 28 | <?php if (!$extended): ?>abstract <?php endif; ?>class <?= $className; ?> extends \admin\ngrest\base\Model |
29 | 29 | { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | return [ |
99 | 99 | <?php foreach ($fieldConfigs as $name => $type): ?> |
100 | - '<?=$name; ?>' => '<?= $type;?>', |
|
100 | + '<?=$name; ?>' => '<?= $type; ?>', |
|
101 | 101 | <?php endforeach; ?>]; |
102 | 102 | } |
103 | 103 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function verbosePrint($message, $section = null) |
36 | 36 | { |
37 | 37 | if ($this->verbose) { |
38 | - $this->output((!empty($section)) ? $section . ': ' . $message : $message); |
|
38 | + $this->output((!empty($section)) ? $section.': '.$message : $message); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $name = substr($name, 0, -(strlen($suffix))); |
118 | 118 | } |
119 | 119 | |
120 | - return $name . $suffix; |
|
120 | + return $name.$suffix; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -73,6 +73,7 @@ |
||
73 | 73 | * @param string $key The identifier key |
74 | 74 | * @param mixed $value The value to store in the cache component. |
75 | 75 | * @param \yii\caching\Dependency $dependency Dependency of the cached item. If the dependency changes, the corresponding value in the cache will be invalidated when it is fetched via get(). This parameter is ignored if $serializer is false. |
76 | + * @param integer $cacheExpiration |
|
76 | 77 | * @return void |
77 | 78 | */ |
78 | 79 | public function setHasCache($key, $value, $dependency = null, $cacheExpiration = null) |
@@ -28,26 +28,26 @@ |
||
28 | 28 | $this->output($fileName); |
29 | 29 | } |
30 | 30 | //$this->output(print_r($fileList, true)); |
31 | - $this->outputInfo(count($fileList) . " files to remove."); |
|
31 | + $this->outputInfo(count($fileList)." files to remove."); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if (count($fileList) !== 0) { |
35 | 35 | $success = true; |
36 | - if ($this->confirm("Do you want to delete " . count($fileList) . " files which are not referenced in the database any more? (can not be undon, maybe create a backup first!)")) { |
|
36 | + if ($this->confirm("Do you want to delete ".count($fileList)." files which are not referenced in the database any more? (can not be undon, maybe create a backup first!)")) { |
|
37 | 37 | foreach ($fileList as $file) { |
38 | 38 | if (is_file($file) && @unlink($file)) { |
39 | - $this->outputSuccess($file . " successful deleted."); |
|
39 | + $this->outputSuccess($file." successful deleted."); |
|
40 | 40 | } elseif (is_file($file)) { |
41 | - $this->outputError($file . " could not be deleted!"); |
|
41 | + $this->outputError($file." could not be deleted!"); |
|
42 | 42 | $success = false; |
43 | 43 | } else { |
44 | - $this->outputError($file . " could not be found!"); |
|
44 | + $this->outputError($file." could not be found!"); |
|
45 | 45 | $success = false; |
46 | 46 | } |
47 | 47 | } |
48 | 48 | } |
49 | 49 | if ($success) { |
50 | - return $this->outputSuccess(count($fileList) . " files successful deleted."); |
|
50 | + return $this->outputSuccess(count($fileList)." files successful deleted."); |
|
51 | 51 | } |
52 | 52 | return $this->outputError("Cleanup could not be completed. Please look into error above."); |
53 | 53 | } |
@@ -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,21 +160,21 @@ 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 | foreach ($v as $kk => $kv) { |
170 | 170 | if (is_array($kv)) { |
171 | - $this->output(" - {$kk}: " . print_r($kv, true)); |
|
171 | + $this->output(" - {$kk}: ".print_r($kv, true)); |
|
172 | 172 | } else { |
173 | 173 | $this->output(" - {$kk}: {$kv}"); |
174 | 174 | } |
175 | 175 | } |
176 | 176 | } else { |
177 | - $this->output(" - " . $v); |
|
177 | + $this->output(" - ".$v); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | } |
@@ -34,19 +34,19 @@ discard block |
||
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
37 | - $appModulesFolder = Yii::$app->basePath . DIRECTORY_SEPARATOR . 'modules'; |
|
38 | - $moduleFolder = $appModulesFolder . DIRECTORY_SEPARATOR . $moduleName; |
|
37 | + $appModulesFolder = Yii::$app->basePath.DIRECTORY_SEPARATOR.'modules'; |
|
38 | + $moduleFolder = $appModulesFolder.DIRECTORY_SEPARATOR.$moduleName; |
|
39 | 39 | |
40 | 40 | if (file_exists($moduleFolder)) { |
41 | - return $this->outputError("The folder " . $moduleFolder . " exists already."); |
|
41 | + return $this->outputError("The folder ".$moduleFolder." exists already."); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $folders = [ |
45 | 45 | 'basePath' => $moduleFolder, |
46 | - 'adminPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin', |
|
47 | - 'frontendPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend', |
|
48 | - 'blocksPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'blocks', |
|
49 | - 'modelsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'models', |
|
46 | + 'adminPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin', |
|
47 | + 'frontendPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend', |
|
48 | + 'blocksPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'blocks', |
|
49 | + 'modelsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'models', |
|
50 | 50 | ]; |
51 | 51 | |
52 | 52 | $vars = ['folders' => $folders, 'name' => $moduleName, 'ns' => 'app\\modules\\'.$moduleName]; |
@@ -56,9 +56,9 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $contents = [ |
59 | - $moduleFolder. DIRECTORY_SEPARATOR . 'README.md' => $this->view->render('@luya/console/commands/views/module/readme.php', $vars), |
|
60 | - $moduleFolder. DIRECTORY_SEPARATOR . 'admin/Module.php' => $this->view->render('@luya/console/commands/views/module/adminmodule.php', $vars), |
|
61 | - $moduleFolder. DIRECTORY_SEPARATOR . 'frontend/Module.php' => $this->view->render('@luya/console/commands/views/module/frontendmodule.php', $vars), |
|
59 | + $moduleFolder.DIRECTORY_SEPARATOR.'README.md' => $this->view->render('@luya/console/commands/views/module/readme.php', $vars), |
|
60 | + $moduleFolder.DIRECTORY_SEPARATOR.'admin/Module.php' => $this->view->render('@luya/console/commands/views/module/adminmodule.php', $vars), |
|
61 | + $moduleFolder.DIRECTORY_SEPARATOR.'frontend/Module.php' => $this->view->render('@luya/console/commands/views/module/frontendmodule.php', $vars), |
|
62 | 62 | ]; |
63 | 63 | |
64 | 64 | foreach ($contents as $fileName => $content) { |
@@ -63,7 +63,7 @@ |
||
63 | 63 | public function getWebroot() |
64 | 64 | { |
65 | 65 | if ($this->_webroot === null) { |
66 | - $this->_webroot = realpath(realpath($this->basePath) . DIRECTORY_SEPARATOR . $this->webrootDirectory); |
|
66 | + $this->_webroot = realpath(realpath($this->basePath).DIRECTORY_SEPARATOR.$this->webrootDirectory); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $this->_webroot; |
@@ -114,9 +114,9 @@ |
||
114 | 114 | $_file = $exception->getFile(); |
115 | 115 | $_line = $exception->getLine(); |
116 | 116 | } elseif (is_string($exception)) { |
117 | - $_message = 'exception string: ' . $exception; |
|
117 | + $_message = 'exception string: '.$exception; |
|
118 | 118 | } elseif (is_array($exception)) { |
119 | - $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: ' . print_r($exception, true); |
|
119 | + $_message = isset($exception['message']) ? $exception['message'] : 'exception array dump: '.print_r($exception, true); |
|
120 | 120 | $_file = isset($exception['file']) ? $exception['file'] : __FILE__; |
121 | 121 | $_line = isset($exception['line']) ? $exception['line'] : __LINE__; |
122 | 122 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | if (!is_object($this->tags[$tag])) { |
64 | 64 | $this->tags[$tag] = Yii::createObject($this->tags[$tag]); |
65 | - Yii::trace('tag parser object generated for:'. $tag, __CLASS__); |
|
65 | + Yii::trace('tag parser object generated for:'.$tag, __CLASS__); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $value = isset($context['value']) ? $context['value'] : false; |