@@ -397,7 +397,7 @@ |
||
| 397 | 397 | * |
| 398 | 398 | * @see ArrayAccess::offsetGet() |
| 399 | 399 | * @param string $offset The key to get from the array. |
| 400 | - * @return mixed The value for the offset key from the array. |
|
| 400 | + * @return string|boolean The value for the offset key from the array. |
|
| 401 | 401 | */ |
| 402 | 402 | public function offsetGet($offset) |
| 403 | 403 | { |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | // see if the module has a registerComponents method |
| 101 | 101 | foreach ($module->registerComponents() as $componentId => $definition) { |
| 102 | 102 | if (!$app->has($componentId)) { |
| 103 | - Yii::trace('Register component ' . $componentId, __METHOD__); |
|
| 103 | + Yii::trace('Register component '.$componentId, __METHOD__); |
|
| 104 | 104 | $app->set($componentId, $definition); |
| 105 | 105 | } |
| 106 | 106 | } |
@@ -55,11 +55,11 @@ |
||
| 55 | 55 | |
| 56 | 56 | $module = Yii::$app->getModule($moduleId); |
| 57 | 57 | |
| 58 | - $folder = $module->basePath . DIRECTORY_SEPARATOR . 'aws'; |
|
| 58 | + $folder = $module->basePath.DIRECTORY_SEPARATOR.'aws'; |
|
| 59 | 59 | |
| 60 | - $file = $folder . DIRECTORY_SEPARATOR . $className . '.php'; |
|
| 60 | + $file = $folder.DIRECTORY_SEPARATOR.$className.'.php'; |
|
| 61 | 61 | |
| 62 | - $content = $this->renderWindowClassView($className, $module->getNamespace() . '\\aws', $moduleId); |
|
| 62 | + $content = $this->renderWindowClassView($className, $module->getNamespace().'\\aws', $moduleId); |
|
| 63 | 63 | |
| 64 | 64 | FileHelper::createDirectory($folder); |
| 65 | 65 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * Render the view file with its parameters. |
| 24 | 24 | * |
| 25 | 25 | * @param string $className |
| 26 | - * @param string $namepsace |
|
| 26 | + * @param string $namespace |
|
| 27 | 27 | * @param string $moduleId |
| 28 | 28 | * @return string |
| 29 | 29 | */ |
@@ -100,22 +100,22 @@ discard block |
||
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $appModulesFolder = Yii::$app->basePath . DIRECTORY_SEPARATOR . 'modules'; |
|
| 104 | - $moduleFolder = $appModulesFolder . DIRECTORY_SEPARATOR . $moduleName; |
|
| 103 | + $appModulesFolder = Yii::$app->basePath.DIRECTORY_SEPARATOR.'modules'; |
|
| 104 | + $moduleFolder = $appModulesFolder.DIRECTORY_SEPARATOR.$moduleName; |
|
| 105 | 105 | |
| 106 | 106 | if (file_exists($moduleFolder)) { |
| 107 | - return $this->outputError("The folder " . $moduleFolder . " exists already."); |
|
| 107 | + return $this->outputError("The folder ".$moduleFolder." exists already."); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $folders = [ |
| 111 | 111 | 'basePath' => $moduleFolder, |
| 112 | - 'adminPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin', |
|
| 113 | - 'adminPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'aws', |
|
| 114 | - 'frontendPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend', |
|
| 115 | - 'blocksPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'blocks', |
|
| 116 | - 'blocksPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'controllers', |
|
| 117 | - 'blocksPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'frontend' . DIRECTORY_SEPARATOR . 'views', |
|
| 118 | - 'modelsPath' => $moduleFolder . DIRECTORY_SEPARATOR . 'models', |
|
| 112 | + 'adminPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin', |
|
| 113 | + 'adminPath' => $moduleFolder.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'aws', |
|
| 114 | + 'frontendPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend', |
|
| 115 | + 'blocksPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'blocks', |
|
| 116 | + 'blocksPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'controllers', |
|
| 117 | + 'blocksPath' => $moduleFolder.DIRECTORY_SEPARATOR.'frontend'.DIRECTORY_SEPARATOR.'views', |
|
| 118 | + 'modelsPath' => $moduleFolder.DIRECTORY_SEPARATOR.'models', |
|
| 119 | 119 | ]; |
| 120 | 120 | |
| 121 | 121 | $ns = 'app\\modules\\'.$moduleName; |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $contents = [ |
| 128 | - $moduleFolder. DIRECTORY_SEPARATOR . 'README.md' => $this->renderReadme($folders, $moduleName, $ns), |
|
| 129 | - $moduleFolder. DIRECTORY_SEPARATOR . 'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns), |
|
| 130 | - $moduleFolder. DIRECTORY_SEPARATOR . 'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns), |
|
| 128 | + $moduleFolder.DIRECTORY_SEPARATOR.'README.md' => $this->renderReadme($folders, $moduleName, $ns), |
|
| 129 | + $moduleFolder.DIRECTORY_SEPARATOR.'admin/Module.php' => $this->renderAdmin($folders, $moduleName, $ns), |
|
| 130 | + $moduleFolder.DIRECTORY_SEPARATOR.'frontend/Module.php' => $this->renderFrontend($folders, $moduleName, $ns), |
|
| 131 | 131 | ]; |
| 132 | 132 | |
| 133 | 133 | foreach ($contents as $fileName => $content) { |
@@ -17,6 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * Humanize the class name |
| 19 | 19 | * |
| 20 | + * @param string $name |
|
| 20 | 21 | * @return string The humanized name. |
| 21 | 22 | */ |
| 22 | 23 | public function humanizeName($name) |