@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function setupStubPath() |
32 | 32 | { |
33 | - Stub::setBasePath(__DIR__ . '/Commands/stubs'); |
|
33 | + Stub::setBasePath(__DIR__.'/Commands/stubs'); |
|
34 | 34 | |
35 | 35 | if (app('modules')->config('stubs.enabled') === true) { |
36 | 36 | Stub::setBasePath(app('modules')->config('stubs.path')); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function registerServices() |
44 | 44 | { |
45 | - $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
45 | + $this->app->singleton(Contracts\RepositoryInterface::class, function($app) { |
|
46 | 46 | $path = $app['config']->get('modules.paths.modules'); |
47 | 47 | |
48 | 48 | return new Lumen\LumenFileRepository($app, $path); |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function setupStubPath() |
32 | 32 | { |
33 | - Stub::setBasePath(__DIR__ . '/Commands/stubs'); |
|
33 | + Stub::setBasePath(__DIR__.'/Commands/stubs'); |
|
34 | 34 | |
35 | - $this->app->booted(function ($app) { |
|
35 | + $this->app->booted(function($app) { |
|
36 | 36 | if ($app['modules']->config('stubs.enabled') === true) { |
37 | 37 | Stub::setBasePath($app['modules']->config('stubs.path')); |
38 | 38 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | protected function registerServices() |
46 | 46 | { |
47 | - $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
47 | + $this->app->singleton(Contracts\RepositoryInterface::class, function($app) { |
|
48 | 48 | $path = $app['config']->get('modules.paths.modules'); |
49 | 49 | |
50 | 50 | return new Laravel\LaravelFileRepository($app, $path); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | 'stubs' => [ |
26 | 26 | 'enabled' => false, |
27 | - 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs', |
|
27 | + 'path' => base_path().'/vendor/nwidart/laravel-modules/src/Commands/stubs', |
|
28 | 28 | 'files' => [ |
29 | 29 | 'routes/web' => 'Routes/web.php', |
30 | 30 | 'routes/api' => 'Routes/api.php', |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | |
79 | 79 | $generatorPath = GenerateConfigReader::read('provider'); |
80 | 80 | |
81 | - return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
81 | + return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php'; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | protected function getWebRoutesPath() |
88 | 88 | { |
89 | - return '/' . $this->laravel['config']->get('stubs.files.routes', 'Routes/web.php'); |
|
89 | + return '/'.$this->laravel['config']->get('stubs.files.routes', 'Routes/web.php'); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function getApiRoutesPath() |
96 | 96 | { |
97 | - return '/' . $this->laravel['config']->get('stubs.files.routes', 'Routes/api.php'); |
|
97 | + return '/'.$this->laravel['config']->get('stubs.files.routes', 'Routes/api.php'); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | public function getDefaultNamespace() : string |
@@ -62,6 +62,9 @@ discard block |
||
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | + /** |
|
66 | + * @param string $path |
|
67 | + */ |
|
65 | 68 | protected function getComposer($path) |
66 | 69 | { |
67 | 70 | return json_decode(file_get_contents($path), true); |
@@ -97,6 +100,10 @@ discard block |
||
97 | 100 | $this->putComposer($moduleComposerPath, $moduleComposer); |
98 | 101 | } |
99 | 102 | |
103 | + /** |
|
104 | + * @param string $path |
|
105 | + * @param Json $data |
|
106 | + */ |
|
100 | 107 | protected function putComposer($path, $data) |
101 | 108 | { |
102 | 109 | file_put_contents($path, json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); |
@@ -6,8 +6,6 @@ |
||
6 | 6 | use Nwidart\Modules\Json; |
7 | 7 | use Nwidart\Modules\Process\Installer; |
8 | 8 | use Nwidart\Modules\Traits\ModuleCommandTrait; |
9 | -use Symfony\Component\Console\Input\InputArgument; |
|
10 | -use Symfony\Component\Console\Input\InputOption; |
|
11 | 9 | use Symfony\Component\Process\Process; |
12 | 10 | |
13 | 11 | class RequireCommand extends Command |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $requireKey = $this->option('dev') ? 'require-dev' : 'require'; |
85 | 85 | $requireOtherKey = $this->option('dev') ? 'require' : 'require-dev'; |
86 | 86 | [$newPackage, $newPackageVersion] = $this->getNewPackageInfo($composer, $requireKey); |
87 | - $moduleComposerPath = $this->getModule()->getPath() . '/composer.json'; |
|
87 | + $moduleComposerPath = $this->getModule()->getPath().'/composer.json'; |
|
88 | 88 | $moduleComposer = $this->getComposer($moduleComposerPath); |
89 | 89 | $moduleComposer = $this->setModuleComposer( |
90 | 90 | $moduleComposer, |
@@ -133,7 +133,6 @@ discard block |
||
133 | 133 | /** |
134 | 134 | * Run the installation process. |
135 | 135 | * |
136 | - * @param bool $dev |
|
137 | 136 | * @return \Symfony\Component\Process\Process |
138 | 137 | */ |
139 | 138 | public function run() |
@@ -168,7 +167,6 @@ discard block |
||
168 | 167 | /** |
169 | 168 | * Get process instance. |
170 | 169 | * |
171 | - * @param bool $dev |
|
172 | 170 | * @return \Symfony\Component\Process\Process |
173 | 171 | */ |
174 | 172 | public function getProcess() |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $process->setTimeout($this->timeout); |
144 | 144 | |
145 | 145 | if ($this->console instanceof Command) { |
146 | - $process->run(function ($type, $line) { |
|
146 | + $process->run(function($type, $line) { |
|
147 | 147 | $this->console->line($line); |
148 | 148 | }); |
149 | 149 | } |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | public function getPackageName() |
267 | 267 | { |
268 | 268 | if (is_null($this->version)) { |
269 | - return $this->name . ':dev-master'; |
|
269 | + return $this->name.':dev-master'; |
|
270 | 270 | } elseif (!$this->version) { |
271 | 271 | return $this->name; |
272 | 272 | } else { |
273 | - return $this->name . ':' . $this->version; |
|
273 | + return $this->name.':'.$this->version; |
|
274 | 274 | } |
275 | 275 | } |
276 | 276 |