@@ -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(); |
@@ -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 | } |
@@ -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)) { |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | return true; |
| 169 | 169 | } else { |
| 170 | 170 | $data = [$this->host, $this->port, $this->smtpSecure, $this->username]; |
| 171 | - throw new Exception('Authentication failed ('.implode(',', $data).'): '.$smtp->getLastReply() . PHP_EOL . print_r($smtp->getError(), true)); |
|
| 171 | + throw new Exception('Authentication failed ('.implode(',', $data).'): '.$smtp->getLastReply().PHP_EOL.print_r($smtp->getError(), true)); |
|
| 172 | 172 | } |
| 173 | 173 | } else { |
| 174 | 174 | throw new Exception('HELO failed: '.$smtp->getLastReply()); |
@@ -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 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | return [ |
| 99 | 99 | 'module' => $this->module->id, |
| 100 | - 'route' => $this->module->id . '/' . $request['route'], |
|
| 100 | + 'route' => $this->module->id.'/'.$request['route'], |
|
| 101 | 101 | 'params' => $request['args'], |
| 102 | 102 | ]; |
| 103 | 103 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | throw new InvalidConfigException(sprintf("Unable to create controller '%s' for module '%s'.", $requestRoute['route'], $this->module->id)); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - Yii::info('LUYA module run module "'.$this->module->id.'" route ' . $requestRoute['route'], __METHOD__); |
|
| 120 | + Yii::info('LUYA module run module "'.$this->module->id.'" route '.$requestRoute['route'], __METHOD__); |
|
| 121 | 121 | |
| 122 | 122 | // run the action on the provided controller object |
| 123 | 123 | return $controller[0]->runAction($controller[1], $requestRoute['args']); |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | { |
| 42 | 42 | $info = pathinfo($file); |
| 43 | 43 | if (!isset($info['extension']) || empty($info['extension'])) { |
| 44 | - $file = rtrim($file, '.') . '.' . $extension; |
|
| 44 | + $file = rtrim($file, '.').'.'.$extension; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | return $file; |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | if (isset($partial[0]) && (count($partial) > 1) && ($module = Yii::$app->getModule($partial[0]))) { |
| 76 | 76 | try { |
| 77 | 77 | // change the controller namespace of this module to make usage of `commands`. |
| 78 | - $module->controllerNamespace = $module->namespace . '\commands'; |
|
| 78 | + $module->controllerNamespace = $module->namespace.'\commands'; |
|
| 79 | 79 | unset($partial[0]); |
| 80 | 80 | // action response |
| 81 | 81 | return $module->runAction(implode("/", $partial), $params); |
@@ -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); |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | * @param string $search Search string to look for. |
| 48 | 48 | * @param string $replace Replacement value for the first found occurrence. |
| 49 | 49 | * @param string $subject The string you want to look up to replace the first element. |
| 50 | - * @return mixed Replaced string |
|
| 50 | + * @return string Replaced string |
|
| 51 | 51 | * @since 1.0.0-rc1 |
| 52 | 52 | */ |
| 53 | 53 | public static function replaceFirst($search, $replace, $subject) |