@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | class Builder extends BaseObject |
| 14 | 14 | { |
| 15 | 15 | public ?string $template = null; |
| 16 | - public array $components = []; |
|
| 16 | + public array $components = [ ]; |
|
| 17 | 17 | public ?string $webAppClass = null; |
| 18 | 18 | public ?string $consoleAppClass = null; |
| 19 | 19 | |
| 20 | - public function build(string|false $file = null): bool|string |
|
| 20 | + public function build(string | false $file = null): bool | string |
|
| 21 | 21 | { |
| 22 | - $prepared = preg_replace_callback('/%.*%/U', function ($m) { |
|
| 23 | - if ($m[0] === '%phpdoc%') { |
|
| 22 | + $prepared = preg_replace_callback('/%.*%/U', function($m) { |
|
| 23 | + if ($m[ 0 ] === '%phpdoc%') { |
|
| 24 | 24 | $string = '/**'; |
| 25 | 25 | |
| 26 | 26 | foreach ($this->components as $name => $classes) { |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | return $string; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if ($m[0] === '%webapp%') { |
|
| 34 | + if ($m[ 0 ] === '%webapp%') { |
|
| 35 | 35 | return $this->webAppClass ?? '\yii\web\Application'; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - if ($m[0] === '%consoleapp%') { |
|
| 38 | + if ($m[ 0 ] === '%consoleapp%') { |
|
| 39 | 39 | return $this->consoleAppClass ?? '\yii\console\Application'; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - return $m[0]; |
|
| 42 | + return $m[ 0 ]; |
|
| 43 | 43 | }, $this->template); |
| 44 | 44 | |
| 45 | 45 | if ($file === null) { |
| 46 | 46 | return $prepared; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - return (bool)file_put_contents($file, $prepared); |
|
| 49 | + return (bool) file_put_contents($file, $prepared); |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | if (is_array($this->controllerMap)) { |
| 44 | 44 | foreach ($this->controllerMap as $name => $controller) { |
| 45 | 45 | if (is_subclass_of($controller, \yii\console\Controller::class)) { |
| 46 | - $app->controllerMap[$name] = $controller; |
|
| 46 | + $app->controllerMap[ $name ] = $controller; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | } |