@@ -31,7 +31,6 @@ |
||
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * @param string $id |
| 34 | - * @param LaravelPlus\Extension\Specs\InputSpec $path |
|
| 35 | 34 | */ |
| 36 | 35 | public function __construct($id, InputSpec $spec) |
| 37 | 36 | { |
@@ -49,8 +49,7 @@ |
||
| 49 | 49 | { |
| 50 | 50 | if (is_string($pathOrSpec)) { |
| 51 | 51 | $spec = $this->make($pathOrSpec); |
| 52 | - } |
|
| 53 | - else { |
|
| 52 | + } else { |
|
| 54 | 53 | $spec = $pathOrSpec; |
| 55 | 54 | } |
| 56 | 55 | |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | { |
| 33 | 33 | if (is_string($pathOrSpec)) { |
| 34 | 34 | $spec = new InputSpec(app('specs'), app('translator'), $pathOrSpec); |
| 35 | - } |
|
| 36 | - else { |
|
| 35 | + } else { |
|
| 37 | 36 | $spec = $pathOrSpec; |
| 38 | 37 | } |
| 39 | 38 | |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | - * Get the addon namespace. |
|
| 75 | + * Get the addon namespace. |
|
| 76 | 76 | * |
| 77 | 77 | * @return $string |
| 78 | 78 | */ |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | if ($this->addon) { |
| 102 | 102 | $directories = $this->addon->config('addon.directories'); |
| 103 | 103 | |
| 104 | - if (! $directories) { |
|
| 104 | + if (!$directories) { |
|
| 105 | 105 | $directories = ['classes']; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -116,8 +116,7 @@ |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | return $this->addon->path($directories[0]); |
| 119 | - } |
|
| 120 | - else { |
|
| 119 | + } else { |
|
| 121 | 120 | return parent::getRootDirectory(); |
| 122 | 121 | } |
| 123 | 122 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | public static function comment() |
| 13 | 13 | { |
| 14 | - return function ($value) { |
|
| 14 | + return function($value) { |
|
| 15 | 15 | $pattern = sprintf('/%s((.|\s)*?)%s/', '{#', '#}'); |
| 16 | 16 | |
| 17 | 17 | return preg_replace($pattern, '<?php /*$1*/ ?>', $value); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public static function script() |
| 27 | 27 | { |
| 28 | - return function ($value) { |
|
| 28 | + return function($value) { |
|
| 29 | 29 | $pattern = sprintf('/%s((.|\s)*?)%s/', '{@', '@}'); |
| 30 | 30 | |
| 31 | 31 | return preg_replace($pattern, '<?php $1; ?>', $value); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $app['path.specs'] = $app->basePath().'/resources/specs'; |
| 42 | 42 | |
| 43 | 43 | // register spec repository |
| 44 | - $app->singleton('specs', function ($app) { |
|
| 44 | + $app->singleton('specs', function($app) { |
|
| 45 | 45 | $loader = new Repository\FileLoader($app['files'], $app['path.specs']); |
| 46 | 46 | |
| 47 | 47 | return new Repository\NamespacedRepository($loader); |
@@ -52,13 +52,13 @@ discard block |
||
| 52 | 52 | $app->alias('addon', AddonEnvironment::class); |
| 53 | 53 | |
| 54 | 54 | // register addon generator |
| 55 | - $app->singleton('addon.generator', function ($app) { |
|
| 55 | + $app->singleton('addon.generator', function($app) { |
|
| 56 | 56 | return new AddonGenerator(); |
| 57 | 57 | }); |
| 58 | 58 | $app->alias('addon.generator', AddonGenerator::class); |
| 59 | 59 | |
| 60 | 60 | // register database migrator |
| 61 | - $app->singleton('database.migrator', function ($app) { |
|
| 61 | + $app->singleton('database.migrator', function($app) { |
|
| 62 | 62 | return new Migrator($app['db'], $app['config']); |
| 63 | 63 | }); |
| 64 | 64 | $app->alias('database.migrator', Migrator::class); |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | * @param string $path |
| 95 | 95 | * @param string $fqcn |
| 96 | 96 | * |
| 97 | - * @return bool |
|
| 97 | + * @return boolean|null |
|
| 98 | 98 | */ |
| 99 | 99 | protected function generateFile(FileGenerator $generator, $path, $fqcn) |
| 100 | 100 | { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Jumilla\Generators\Laravel\OneFileGeneratorCommand as BaseCommand; |
| 6 | 6 | use Jumilla\Generators\FileGenerator; |
| 7 | -use LaravelPlus\Extension\Addons\Addon; |
|
| 8 | 7 | use LaravelPlus\Extension\Generators\GeneratorCommandTrait; |
| 9 | 8 | use InvalidArgumentException; |
| 10 | 9 | |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | |
| 88 | 88 | return $generator->file($path)->template($this->getStub(), [ |
| 89 | 89 | 'namespace' => $namespace, |
| 90 | - 'root_namespace' => $this->getAppNamespace(), // use App\Http\Controllers\Controller |
|
| 90 | + 'root_namespace' => $this->getAppNamespace(), // use App\Http\Controllers\Controller |
|
| 91 | 91 | 'class' => $class, |
| 92 | 92 | 'model_namespace' => $model_namespace ? $model_namespace.'\\' : '', |
| 93 | 93 | 'model_class' => $model_class, |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | * @param string $path |
| 95 | 95 | * @param string $fqcn |
| 96 | 96 | * |
| 97 | - * @return bool |
|
| 97 | + * @return boolean|null |
|
| 98 | 98 | */ |
| 99 | 99 | protected function generateFile(FileGenerator $generator, $path, $fqcn) |
| 100 | 100 | { |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Jumilla\Generators\Laravel\OneFileGeneratorCommand as BaseCommand; |
| 6 | 6 | use Jumilla\Generators\FileGenerator; |
| 7 | -use LaravelPlus\Extension\Addons\Addon; |
|
| 8 | 7 | use LaravelPlus\Extension\Generators\GeneratorCommandTrait; |
| 9 | 8 | use Illuminate\Support\Str; |
| 10 | 9 | |
@@ -97,7 +97,7 @@ |
||
| 97 | 97 | |
| 98 | 98 | return $generator->file($path)->template($this->getStub(), [ |
| 99 | 99 | 'namespace' => $namespace, |
| 100 | - 'root_namespace' => $this->getAppNamespace(), // use App\Events\{$event} |
|
| 100 | + 'root_namespace' => $this->getAppNamespace(), // use App\Events\{$event} |
|
| 101 | 101 | 'class' => $class, |
| 102 | 102 | 'event' => $this->option('event'), |
| 103 | 103 | ]); |