@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | /** |
| 101 | 101 | * Run the application based on the Sapi Name. |
| 102 | 102 | * |
| 103 | - * @return luya\web\Application|luya\cli\Application Application objected based on the sapi name. |
|
| 103 | + * @return null|integer Application objected based on the sapi name. |
|
| 104 | 104 | */ |
| 105 | 105 | public function run() |
| 106 | 106 | { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | /** |
| 134 | 134 | * Run Web-Application based on the provided config file. |
| 135 | 135 | * |
| 136 | - * @return string|void Returns the Yii Application run() method if mock is disabled. Otherwise returns void |
|
| 136 | + * @return integer|null Returns the Yii Application run() method if mock is disabled. Otherwise returns void |
|
| 137 | 137 | */ |
| 138 | 138 | public function applicationWeb() |
| 139 | 139 | { |
@@ -196,7 +196,7 @@ |
||
| 196 | 196 | /** |
| 197 | 197 | * The import method will be called from exec/import command. |
| 198 | 198 | * |
| 199 | - * @return void|string |
|
| 199 | + * @return boolean |
|
| 200 | 200 | */ |
| 201 | 201 | public function import(\luya\console\interfaces\ImportController $exec) |
| 202 | 202 | { |
@@ -56,6 +56,11 @@ discard block |
||
| 56 | 56 | ]; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | + /** |
|
| 60 | + * @param string $type |
|
| 61 | + * @param string $varName |
|
| 62 | + * @param string $func |
|
| 63 | + */ |
|
| 59 | 64 | private function getExtraVarDef($type, $varName, $func) |
| 60 | 65 | { |
| 61 | 66 | $info = [ |
@@ -72,6 +77,9 @@ discard block |
||
| 72 | 77 | return false; |
| 73 | 78 | } |
| 74 | 79 | |
| 80 | + /** |
|
| 81 | + * @param string $type |
|
| 82 | + */ |
|
| 75 | 83 | private function getVariableTypeOption($type) |
| 76 | 84 | { |
| 77 | 85 | $types = $this->getVariableTypesOptions(); |
@@ -79,6 +87,9 @@ discard block |
||
| 79 | 87 | return $types[$type]; |
| 80 | 88 | } |
| 81 | 89 | |
| 90 | + /** |
|
| 91 | + * @param string $type |
|
| 92 | + */ |
|
| 82 | 93 | private function hasVariableTypeOption($type) |
| 83 | 94 | { |
| 84 | 95 | return array_key_exists($type, $this->getVariableTypesOptions()); |
@@ -292,6 +303,9 @@ discard block |
||
| 292 | 303 | return $this->outputError("Error while creating file '$file'"); |
| 293 | 304 | } |
| 294 | 305 | |
| 306 | + /** |
|
| 307 | + * @param string $prefix |
|
| 308 | + */ |
|
| 295 | 309 | private function placeholderCreator($prefix) |
| 296 | 310 | { |
| 297 | 311 | $this->output(PHP_EOL.'-> Create new '.$prefix, Console::FG_YELLOW); |
@@ -310,8 +324,8 @@ discard block |
||
| 310 | 324 | |
| 311 | 325 | /** |
| 312 | 326 | * |
| 313 | - * @param unknown $prefix |
|
| 314 | - * @param string $type 'var', 'cfg' |
|
| 327 | + * @param string $prefix |
|
| 328 | + * @param string $typeCast |
|
| 315 | 329 | * @return multitype:string Ambigous <string, array> |
| 316 | 330 | */ |
| 317 | 331 | private function varCreator($prefix, $typeCast) |
@@ -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; |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | /** |
| 80 | 80 | * Use --verbose=1 to enable smtp debug output |
| 81 | 81 | * |
| 82 | - * @return bool|null |
|
| 82 | + * @return integer|null |
|
| 83 | 83 | * @throws Exception On smtp failure |
| 84 | 84 | */ |
| 85 | 85 | public function actionMailer() |
@@ -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)) { |
@@ -42,6 +42,11 @@ |
||
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param string|boolean $module |
|
| 47 | + * |
|
| 48 | + * @return string |
|
| 49 | + */ |
|
| 45 | 50 | private function getModuleMigrationDirectorie($module) |
| 46 | 51 | { |
| 47 | 52 | if (!array_key_exists($module, $this->moduleMigrationDirectories)) { |
@@ -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(); |
@@ -9,6 +9,9 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class SetupController extends \luya\console\Command |
| 11 | 11 | { |
| 12 | + /** |
|
| 13 | + * @param string $table |
|
| 14 | + */ |
|
| 12 | 15 | private function insert($table, $fields) |
| 13 | 16 | { |
| 14 | 17 | return Yii::$app->db->createCommand()->insert($table, $fields)->execute(); |
@@ -84,8 +87,6 @@ discard block |
||
| 84 | 87 | * @todo use options instead, override options() |
| 85 | 88 | * @todo see if admin is availoable |
| 86 | 89 | * |
| 87 | - * @param string $email |
|
| 88 | - * @param string $password |
|
| 89 | 90 | */ |
| 90 | 91 | public function actionIndex() |
| 91 | 92 | { |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | * |
| 38 | 38 | * @param string $route |
| 39 | 39 | * @param array $params |
| 40 | - * @param boolean $sheme Whether to return static url or not |
|
| 40 | + * @param boolean $scheme Whether to return static url or not |
|
| 41 | 41 | * @todo we have to remove this method as it provides no additinal functions to the yii\helpers\url to method |
| 42 | 42 | */ |
| 43 | 43 | public static function toManager($route, array $params = [], $scheme = false) |
@@ -234,7 +234,7 @@ |
||
| 234 | 234 | /** |
| 235 | 235 | * Return a path like string with all composition with trailing slash e.g. us/e. |
| 236 | 236 | * |
| 237 | - * @return void|string |
|
| 237 | + * @return string |
|
| 238 | 238 | */ |
| 239 | 239 | public function getFull() |
| 240 | 240 | { |
@@ -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 | } |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Goutte\Client; |
| 6 | 6 | use yii\base\InvalidConfigException; |
| 7 | 7 | use yii\base\yii\base; |
| 8 | -use luya\helpers\Url; |
|
| 9 | 8 | |
| 10 | 9 | class CrawlPage extends \yii\base\Object |
| 11 | 10 | { |
@@ -28,6 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | private $_composition = null; |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param Request $request |
|
| 33 | + */ |
|
| 31 | 34 | public function parseRequest($request) |
| 32 | 35 | { |
| 33 | 36 | // extra data from request to composition, which changes the pathInfo of the Request-Object. |
@@ -91,6 +94,9 @@ discard block |
||
| 91 | 94 | return $this->_menu; |
| 92 | 95 | } |
| 93 | 96 | |
| 97 | + /** |
|
| 98 | + * @return Composition |
|
| 99 | + */ |
|
| 94 | 100 | public function getComposition() |
| 95 | 101 | { |
| 96 | 102 | if ($this->_composition === null) { |
@@ -105,6 +111,9 @@ discard block |
||
| 105 | 111 | return rtrim($this->baseUrl, '/').'/'.ltrim($route, '/'); |
| 106 | 112 | } |
| 107 | 113 | |
| 114 | + /** |
|
| 115 | + * @return string |
|
| 116 | + */ |
|
| 108 | 117 | public function removeBaseUrl($route) |
| 109 | 118 | { |
| 110 | 119 | return preg_replace('#'.preg_quote($this->baseUrl).'#', '', $route, 1); |
@@ -133,6 +142,11 @@ discard block |
||
| 133 | 142 | return $this->urlReplaceModule($url, $navItemId, $composition); |
| 134 | 143 | } |
| 135 | 144 | |
| 145 | + /** |
|
| 146 | + * @param string $route |
|
| 147 | + * |
|
| 148 | + * @return string |
|
| 149 | + */ |
|
| 136 | 150 | private function findModuleInRoute($route) |
| 137 | 151 | { |
| 138 | 152 | $parts = array_values(array_filter(explode('/', $route))); |
@@ -146,6 +160,9 @@ discard block |
||
| 146 | 160 | return false; |
| 147 | 161 | } |
| 148 | 162 | |
| 163 | + /** |
|
| 164 | + * @param string $url |
|
| 165 | + */ |
|
| 149 | 166 | private function urlReplaceModule($url, $navItemId, \luya\web\Composition $composition) |
| 150 | 167 | { |
| 151 | 168 | $route = $this->removeBaseUrl($url); |