@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | /** |
| 234 | 234 | * Passthru command. |
| 235 | 235 | * @param string $command |
| 236 | - * @param array $args |
|
| 236 | + * @param string[] $args |
|
| 237 | 237 | * @return int exit code |
| 238 | 238 | */ |
| 239 | 239 | private function passthru($command, $args) |
@@ -299,6 +299,9 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | + /** |
|
| 303 | + * @param string $value |
|
| 304 | + */ |
|
| 302 | 305 | public function setRootDir($value) |
| 303 | 306 | { |
| 304 | 307 | $this->_rootDir = $value; |
@@ -330,6 +333,9 @@ discard block |
||
| 330 | 333 | throw new InvalidParamException("Not a hidev project (or any of the parent directories).\nUse `hidev init` to initialize hidev project."); |
| 331 | 334 | } |
| 332 | 335 | |
| 336 | + /** |
|
| 337 | + * @param string $subpath |
|
| 338 | + */ |
|
| 333 | 339 | public function buildRootPath($subpath) |
| 334 | 340 | { |
| 335 | 341 | return $this->getRootDir() . DIRECTORY_SEPARATOR . $subpath; |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | Yii::setAlias('@runtime', $this->buildRootPath('.hidev/runtime')); |
| 164 | 164 | |
| 165 | 165 | $package = $this->goals['package']; |
| 166 | - $alias = isset($package['namespace']) ? strtr($package['namespace'], '\\', '/') : ''; |
|
| 167 | - if ($alias && !Yii::getAlias('@' . $alias, false)) { |
|
| 168 | - $srcdir = Yii::getAlias('@root/' . ($package['src'] ?: 'src')); |
|
| 166 | + $alias = isset($package['namespace']) ? strtr($package['namespace'], '\\', '/') : ''; |
|
| 167 | + if ($alias && !Yii::getAlias('@'.$alias, false)) { |
|
| 168 | + $srcdir = Yii::getAlias('@root/'.($package['src'] ?: 'src')); |
|
| 169 | 169 | Yii::setAlias($alias, $srcdir); |
| 170 | 170 | } |
| 171 | 171 | $aliases = $this->goals['aliases']; |
@@ -332,6 +332,6 @@ discard block |
||
| 332 | 332 | |
| 333 | 333 | public function buildRootPath($subpath) |
| 334 | 334 | { |
| 335 | - return $this->getRootDir() . DIRECTORY_SEPARATOR . $subpath; |
|
| 335 | + return $this->getRootDir().DIRECTORY_SEPARATOR.$subpath; |
|
| 336 | 336 | } |
| 337 | 337 | } |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | 'singletons' => [ |
| 99 | 99 | \hidev\base\Interpolator::class => [ |
| 100 | 100 | ], |
| 101 | - 'Detect VCS' => function () { |
|
| 101 | + 'Detect VCS' => function() { |
|
| 102 | 102 | $detectedVCS = 'git'; |
| 103 | 103 | return Yii::$app->get($detectedVCS); |
| 104 | 104 | }, |