@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function decodeContents(): array |
127 | 127 | { |
128 | - $attributes = json_decode($this->getContents(), 1); |
|
128 | + $attributes = json_decode($this->getContents(), 1); |
|
129 | 129 | |
130 | 130 | // any JSON parsing errors should throw an exception |
131 | 131 | if (json_last_error() > 0) { |
132 | - throw new InvalidJsonException('Error processing file: ' . $this->getPath() . '. Error: ' . json_last_error_msg()); |
|
132 | + throw new InvalidJsonException('Error processing file: '.$this->getPath().'. Error: '.json_last_error_msg()); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return $attributes; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | return $this->decodeContents(); |
148 | 148 | } |
149 | 149 | |
150 | - return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function () { |
|
150 | + return app('cache')->store(config('modules.cache.driver'))->remember($this->getPath(), config('modules.cache.lifetime'), function() { |
|
151 | 151 | return $this->decodeContents(); |
152 | 152 | }); |
153 | 153 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function setupStubPath(): void |
35 | 35 | { |
36 | - Stub::setBasePath(__DIR__ . '/Commands/stubs'); |
|
36 | + Stub::setBasePath(__DIR__.'/Commands/stubs'); |
|
37 | 37 | |
38 | 38 | if (app('modules')->config('stubs.enabled') === true) { |
39 | 39 | Stub::setBasePath(app('modules')->config('stubs.path')); |
@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | */ |
46 | 46 | protected function registerServices(): void |
47 | 47 | { |
48 | - $this->app->singleton(RepositoryInterface::class, function ($app) { |
|
48 | + $this->app->singleton(RepositoryInterface::class, function($app) { |
|
49 | 49 | $path = $app['config']->get('modules.paths.modules'); |
50 | 50 | |
51 | 51 | return new LumenFileRepository($app, $path); |
52 | 52 | }); |
53 | 53 | |
54 | - $this->app->singleton(ActivatorInterface::class, function ($app) { |
|
54 | + $this->app->singleton(ActivatorInterface::class, function($app) { |
|
55 | 55 | $activator = $app['config']->get('modules.activator'); |
56 | - $class = $app['config']->get('modules.activators.' . $activator)['class']; |
|
56 | + $class = $app['config']->get('modules.activators.'.$activator)['class']; |
|
57 | 57 | |
58 | 58 | return new $class($app); |
59 | 59 | }); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $string = ''; |
63 | 63 | foreach ($pieces as $i => $piece) { |
64 | 64 | if ($i + 1 < count($pieces)) { |
65 | - $string .= strtolower($piece) . '_'; |
|
65 | + $string .= strtolower($piece).'_'; |
|
66 | 66 | } else { |
67 | 67 | $string .= Str::plural(strtolower($piece)); |
68 | 68 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | private function handleOptionalMigrationOption(): void |
108 | 108 | { |
109 | 109 | if ($this->option('migration') === true) { |
110 | - $migrationName = 'create_' . $this->createMigrationName() . '_table'; |
|
110 | + $migrationName = 'create_'.$this->createMigrationName().'_table'; |
|
111 | 111 | $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]); |
112 | 112 | } |
113 | 113 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | $modelPath = GenerateConfigReader::read('model'); |
200 | 200 | |
201 | - return $path . $modelPath->getPath() . '/' . $this->getModelName() . '.php'; |
|
201 | + return $path.$modelPath->getPath().'/'.$this->getModelName().'.php'; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | private function getModelName(): string |
@@ -68,7 +68,7 @@ |
||
68 | 68 | |
69 | 69 | $requestPath = GenerateConfigReader::read('request'); |
70 | 70 | |
71 | - return $path . $requestPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
71 | + return $path.$requestPath->getPath().'/'.$this->getFileName().'.php'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | private function getFileName(): string |
@@ -114,15 +114,15 @@ |
||
114 | 114 | |
115 | 115 | $generatorPath = GenerateConfigReader::read('migration'); |
116 | 116 | |
117 | - return $path . $generatorPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
117 | + return $path.$generatorPath->getPath().'/'.$this->getFileName().'.php'; |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | private function getFileName(): string |
121 | 121 | { |
122 | - return date('Y_m_d_His_') . $this->getSchemaName(); |
|
122 | + return date('Y_m_d_His_').$this->getSchemaName(); |
|
123 | 123 | } |
124 | 124 | |
125 | - private function getSchemaName(): bool|array|string|null |
|
125 | + private function getSchemaName(): bool | array | string | null |
|
126 | 126 | { |
127 | 127 | return $this->argument('name'); |
128 | 128 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | $path = str_replace('/', '\\', $path); |
71 | 71 | |
72 | - return $this->laravel['modules']->config('namespace') . '\\' . $this->laravel['modules']->findOrFail($this->getModuleName()) . '\\' . $path; |
|
72 | + return $this->laravel['modules']->config('namespace').'\\'.$this->laravel['modules']->findOrFail($this->getModuleName()).'\\'.$path; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | private function getModelName(): string |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | private function getModelVariable(): string |
81 | 81 | { |
82 | - return '$' . Str::lower($this->argument('name')); |
|
82 | + return '$'.Str::lower($this->argument('name')); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | protected function getDestinationFilePath(): string |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | |
89 | 89 | $observerPath = GenerateConfigReader::read('observer'); |
90 | 90 | |
91 | - return $path . $observerPath->getPath() . '/' . $this->getFileName(); |
|
91 | + return $path.$observerPath->getPath().'/'.$this->getFileName(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | private function getFileName(): string |
95 | 95 | { |
96 | - return Str::studly($this->argument('name')) . 'Observer.php'; |
|
96 | + return Str::studly($this->argument('name')).'Observer.php'; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | public function handle(): int |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | $controllerPath = GenerateConfigReader::read('controller'); |
47 | 47 | |
48 | - return $path . $controllerPath->getPath() . '/' . $this->getControllerName() . '.php'; |
|
48 | + return $path.$controllerPath->getPath().'/'.$this->getControllerName().'.php'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function getTemplateContents(): string |
@@ -86,7 +86,7 @@ |
||
86 | 86 | |
87 | 87 | $jobPath = GenerateConfigReader::read('jobs'); |
88 | 88 | |
89 | - return $path . $jobPath->getPath() . '/' . $this->getFileName() . '.php'; |
|
89 | + return $path.$jobPath->getPath().'/'.$this->getFileName().'.php'; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | private function getFileName(): string |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | $resourcePath = GenerateConfigReader::read('resource'); |
61 | 61 | |
62 | - return $path . $resourcePath->getPath() . '/' . $this->getFileName() . '.php'; |
|
62 | + return $path.$resourcePath->getPath().'/'.$this->getFileName().'.php'; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | private function getFileName(): string |