@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | protected function getArguments() |
72 | 72 | { |
73 | 73 | return [ |
74 | - ['model', InputArgument::REQUIRED, 'The name of model will be created.'], |
|
75 | - ['module', InputArgument::OPTIONAL, 'The name of module will be used.'], |
|
74 | + [ 'model', InputArgument::REQUIRED, 'The name of model will be created.' ], |
|
75 | + [ 'module', InputArgument::OPTIONAL, 'The name of module will be used.' ], |
|
76 | 76 | ]; |
77 | 77 | } |
78 | 78 | |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | protected function getOptions() |
85 | 85 | { |
86 | 86 | return [ |
87 | - ['fillable', null, InputOption::VALUE_OPTIONAL, 'The fillable attributes.', null], |
|
88 | - ['migration', 'm', InputOption::VALUE_NONE, 'Flag to create associated migrations', null], |
|
87 | + [ 'fillable', null, InputOption::VALUE_OPTIONAL, 'The fillable attributes.', null ], |
|
88 | + [ 'migration', 'm', InputOption::VALUE_NONE, 'Flag to create associated migrations', null ], |
|
89 | 89 | ]; |
90 | 90 | } |
91 | 91 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | if ($this->option('migration') === true) { |
98 | 98 | $migrationName = 'create_'.$this->createMigrationName().'_table'; |
99 | - $this->call('module:make-migration', ['name' => $migrationName, 'module' => $this->argument('module')]); |
|
99 | + $this->call('module:make-migration', [ 'name' => $migrationName, 'module' => $this->argument('module') ]); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | protected function getTemplateContents() |
107 | 107 | { |
108 | - $module = $this->laravel['modules']->findOrFail($this->getModuleName()); |
|
108 | + $module = $this->laravel[ 'modules' ]->findOrFail($this->getModuleName()); |
|
109 | 109 | |
110 | 110 | return (new Stub('/model.stub', [ |
111 | 111 | 'NAME' => $this->getModelName(), |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'LOWER_NAME' => $module->getLowerName(), |
116 | 116 | 'MODULE' => $this->getModuleName(), |
117 | 117 | 'STUDLY_NAME' => $module->getStudlyName(), |
118 | - 'MODULE_NAMESPACE' => $this->laravel['modules']->config('namespace'), |
|
118 | + 'MODULE_NAMESPACE' => $this->laravel[ 'modules' ]->config('namespace'), |
|
119 | 119 | ]))->render(); |
120 | 120 | } |
121 | 121 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | protected function getDestinationFilePath() |
126 | 126 | { |
127 | - $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
|
127 | + $path = $this->laravel[ 'modules' ]->getModulePath($this->getModuleName()); |
|
128 | 128 | |
129 | 129 | $modelPath = GenerateConfigReader::read('model'); |
130 | 130 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | { |
147 | 147 | $fillable = $this->option('fillable'); |
148 | 148 | |
149 | - if (! is_null($fillable)) { |
|
149 | + if (!is_null($fillable)) { |
|
150 | 150 | $arrays = explode(',', $fillable); |
151 | 151 | |
152 | 152 | return json_encode($arrays); |
@@ -162,6 +162,6 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function getDefaultNamespace() : string |
164 | 164 | { |
165 | - return $this->laravel['modules']->config('paths.generator.model.path', 'Entities'); |
|
165 | + return $this->laravel[ 'modules' ]->config('paths.generator.model.path', 'Entities'); |
|
166 | 166 | } |
167 | 167 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function getDefaultNamespace() : string |
37 | 37 | { |
38 | - return $this->laravel['modules']->config('paths.generator.policies.path', 'Policies'); |
|
38 | + return $this->laravel[ 'modules' ]->config('paths.generator.policies.path', 'Policies'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | protected function getArguments() |
47 | 47 | { |
48 | 48 | return [ |
49 | - ['name', InputArgument::REQUIRED, 'The name of the policy class.'], |
|
50 | - ['module', InputArgument::OPTIONAL, 'The name of module will be used.'], |
|
49 | + [ 'name', InputArgument::REQUIRED, 'The name of the policy class.' ], |
|
50 | + [ 'module', InputArgument::OPTIONAL, 'The name of module will be used.' ], |
|
51 | 51 | ]; |
52 | 52 | } |
53 | 53 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | protected function getTemplateContents() |
58 | 58 | { |
59 | - $module = $this->laravel['modules']->findOrFail($this->getModuleName()); |
|
59 | + $module = $this->laravel[ 'modules' ]->findOrFail($this->getModuleName()); |
|
60 | 60 | |
61 | 61 | return (new Stub('/policy.plain.stub', [ |
62 | 62 | 'NAMESPACE' => $this->getClassNamespace($module), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | protected function getDestinationFilePath() |
71 | 71 | { |
72 | - $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
|
72 | + $path = $this->laravel[ 'modules' ]->getModulePath($this->getModuleName()); |
|
73 | 73 | |
74 | 74 | $policyPath = GenerateConfigReader::read('policies'); |
75 | 75 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | protected function getEventName(): string |
50 | 50 | { |
51 | - return once(function () { |
|
51 | + return once(function() { |
|
52 | 52 | $eventName = $this->option('event') ?? $this->ask('What is the name of the event that should be listened on?', false) ?? 'null'; |
53 | 53 | if ($eventName === null) { |
54 | 54 | throw new Exception('Eventname for listener not given'); |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | |
61 | 61 | protected function listenerNeedsQueueing(): bool |
62 | 62 | { |
63 | - return once(function () { |
|
63 | + return once(function() { |
|
64 | 64 | $option = $this->option('queued'); |
65 | 65 | |
66 | - return app()->runningInConsole() && ! $option ? $this->confirm('Should the listener be queued?', false) : $option; |
|
66 | + return app()->runningInConsole() && !$option ? $this->confirm('Should the listener be queued?', false) : $option; |
|
67 | 67 | }); |
68 | 68 | } |
69 | 69 | |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | protected function getOptions() |
93 | 93 | { |
94 | 94 | return [ |
95 | - ['event', 'e', InputOption::VALUE_OPTIONAL, 'The event class being listened for.'], |
|
96 | - ['queued', null, InputOption::VALUE_NONE, 'Indicates the event listener should be queued.'], |
|
95 | + [ 'event', 'e', InputOption::VALUE_OPTIONAL, 'The event class being listened for.' ], |
|
96 | + [ 'queued', null, InputOption::VALUE_NONE, 'Indicates the event listener should be queued.' ], |
|
97 | 97 | ]; |
98 | 98 | } |
99 | 99 | } |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | protected function getArguments() |
38 | 38 | { |
39 | 39 | return [ |
40 | - ['name', InputArgument::REQUIRED, 'The migration name will be created.'], |
|
41 | - ['module', InputArgument::OPTIONAL, 'The name of module will be created.'], |
|
40 | + [ 'name', InputArgument::REQUIRED, 'The migration name will be created.' ], |
|
41 | + [ 'module', InputArgument::OPTIONAL, 'The name of module will be created.' ], |
|
42 | 42 | ]; |
43 | 43 | } |
44 | 44 | |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | protected function getOptions() |
51 | 51 | { |
52 | 52 | return [ |
53 | - ['fields', null, InputOption::VALUE_OPTIONAL, 'The specified fields table.', null], |
|
54 | - ['plain', null, InputOption::VALUE_NONE, 'Create plain migration.'], |
|
53 | + [ 'fields', null, InputOption::VALUE_OPTIONAL, 'The specified fields table.', null ], |
|
54 | + [ 'plain', null, InputOption::VALUE_NONE, 'Create plain migration.' ], |
|
55 | 55 | ]; |
56 | 56 | } |
57 | 57 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected function getDestinationFilePath() |
114 | 114 | { |
115 | - $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
|
115 | + $path = $this->laravel[ 'modules' ]->getModulePath($this->getModuleName()); |
|
116 | 116 | |
117 | 117 | $generatorPath = GenerateConfigReader::read('migration'); |
118 | 118 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function getDefaultNamespace() : string |
31 | 31 | { |
32 | - return $this->laravel['modules']->config('paths.generator.emails.path', 'Emails'); |
|
32 | + return $this->laravel[ 'modules' ]->config('paths.generator.emails.path', 'Emails'); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | protected function getArguments() |
41 | 41 | { |
42 | 42 | return [ |
43 | - ['name', InputArgument::REQUIRED, 'The name of the mailable.'], |
|
44 | - ['module', InputArgument::OPTIONAL, 'The name of module will be used.'], |
|
43 | + [ 'name', InputArgument::REQUIRED, 'The name of the mailable.' ], |
|
44 | + [ 'module', InputArgument::OPTIONAL, 'The name of module will be used.' ], |
|
45 | 45 | ]; |
46 | 46 | } |
47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | protected function getTemplateContents() |
54 | 54 | { |
55 | - $module = $this->laravel['modules']->findOrFail($this->getModuleName()); |
|
55 | + $module = $this->laravel[ 'modules' ]->findOrFail($this->getModuleName()); |
|
56 | 56 | |
57 | 57 | return (new Stub('/mail.stub', [ |
58 | 58 | 'NAMESPACE' => $this->getClassNamespace($module), |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | protected function getDestinationFilePath() |
69 | 69 | { |
70 | - $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
|
70 | + $path = $this->laravel[ 'modules' ]->getModulePath($this->getModuleName()); |
|
71 | 71 | |
72 | 72 | $mailPath = GenerateConfigReader::read('emails'); |
73 | 73 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | public function getDefaultNamespace() : string |
37 | 37 | { |
38 | - return $this->laravel['modules']->config('paths.generator.request.path', 'Http/Requests'); |
|
38 | + return $this->laravel[ 'modules' ]->config('paths.generator.request.path', 'Http/Requests'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | protected function getArguments() |
47 | 47 | { |
48 | 48 | return [ |
49 | - ['name', InputArgument::REQUIRED, 'The name of the form request class.'], |
|
50 | - ['module', InputArgument::OPTIONAL, 'The name of module will be used.'], |
|
49 | + [ 'name', InputArgument::REQUIRED, 'The name of the form request class.' ], |
|
50 | + [ 'module', InputArgument::OPTIONAL, 'The name of module will be used.' ], |
|
51 | 51 | ]; |
52 | 52 | } |
53 | 53 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | protected function getTemplateContents() |
58 | 58 | { |
59 | - $module = $this->laravel['modules']->findOrFail($this->getModuleName()); |
|
59 | + $module = $this->laravel[ 'modules' ]->findOrFail($this->getModuleName()); |
|
60 | 60 | |
61 | 61 | return (new Stub('/request.stub', [ |
62 | 62 | 'NAMESPACE' => $this->getClassNamespace($module), |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | protected function getDestinationFilePath() |
71 | 71 | { |
72 | - $path = $this->laravel['modules']->getModulePath($this->getModuleName()); |
|
72 | + $path = $this->laravel[ 'modules' ]->getModulePath($this->getModuleName()); |
|
73 | 73 | |
74 | 74 | $requestPath = GenerateConfigReader::read('request'); |
75 | 75 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | protected function getModuleName(): string |
61 | 61 | { |
62 | - return once(function () { |
|
62 | + return once(function() { |
|
63 | 63 | return Str::studly($this->askModuleName()); |
64 | 64 | }); |
65 | 65 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | protected function getClassName(): string |
117 | 117 | { |
118 | - return once(function () { |
|
118 | + return once(function() { |
|
119 | 119 | return Str::studly($this->askClassName()); |
120 | 120 | }); |
121 | 121 | } |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | protected function getArguments() |
140 | 140 | { |
141 | 141 | return [ |
142 | - ['module', InputArgument::OPTIONAL, 'The name of module will be used.'], |
|
143 | - ['name', InputArgument::OPTIONAL, 'The name of the '.$this->getGeneratorName().'.'], |
|
142 | + [ 'module', InputArgument::OPTIONAL, 'The name of module will be used.' ], |
|
143 | + [ 'name', InputArgument::OPTIONAL, 'The name of the '.$this->getGeneratorName().'.' ], |
|
144 | 144 | ]; |
145 | 145 | } |
146 | 146 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('get_module_path')) { |
|
3 | +if (!function_exists('get_module_path')) { |
|
4 | 4 | function get_module_path(string $module) |
5 | 5 | { |
6 | 6 | $module = ucfirst($module); |
@@ -12,21 +12,21 @@ discard block |
||
12 | 12 | } |
13 | 13 | } |
14 | 14 | |
15 | -if (! function_exists('get_foundation_path')) { |
|
15 | +if (!function_exists('get_foundation_path')) { |
|
16 | 16 | function get_foundation_path() |
17 | 17 | { |
18 | 18 | return base_path('src/Foundation'); |
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
22 | -if (! function_exists('get_authenticated_user_id')) { |
|
22 | +if (!function_exists('get_authenticated_user_id')) { |
|
23 | 23 | function get_authenticated_user_id() |
24 | 24 | { |
25 | 25 | return get_authenticated_user()->id; |
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | -if (! function_exists('get_authenticated_user')) { |
|
29 | +if (!function_exists('get_authenticated_user')) { |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @return \Modules\User\Entities\User |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
44 | -if (! function_exists('get_short_class_name')) { |
|
44 | +if (!function_exists('get_short_class_name')) { |
|
45 | 45 | function get_short_class_name($class) |
46 | 46 | { |
47 | - if (! is_string($class)) { |
|
47 | + if (!is_string($class)) { |
|
48 | 48 | $class = get_class($class); |
49 | 49 | } |
50 | 50 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
55 | -if (! function_exists('get_random_array_element')) { |
|
55 | +if (!function_exists('get_random_array_element')) { |
|
56 | 56 | function get_random_array_element(array $array) |
57 | 57 | { |
58 | 58 | if (empty($array)) { |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | } |
61 | 61 | $randomIndex = random_int(0, count($array) - 1); |
62 | 62 | |
63 | - return $array[$randomIndex]; |
|
63 | + return $array[ $randomIndex ]; |
|
64 | 64 | } |
65 | 65 | } |
66 | -if (! function_exists('create_multiple_from_factory')) { |
|
66 | +if (!function_exists('create_multiple_from_factory')) { |
|
67 | 67 | function create_multiple_from_factory(string $modelClass, $amount = 1, ?string $state = null) |
68 | 68 | { |
69 | 69 | if ($amount < 1) { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | -if (! function_exists('create_from_factory')) { |
|
83 | +if (!function_exists('create_from_factory')) { |
|
84 | 84 | function create_from_factory(string $modelClass, ?string $state = null) |
85 | 85 | { |
86 | 86 | $factory = factory($modelClass); |
@@ -93,33 +93,33 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | -if (! function_exists('class_implements_interface')) { |
|
96 | +if (!function_exists('class_implements_interface')) { |
|
97 | 97 | function class_implements_interface($class, $interface) |
98 | 98 | { |
99 | 99 | return in_array($interface, class_implements($class)); |
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
103 | -if (! function_exists('class_uses_trait')) { |
|
103 | +if (!function_exists('class_uses_trait')) { |
|
104 | 104 | function class_uses_trait($class, string $trait) |
105 | 105 | { |
106 | - if (! is_string($class)) { |
|
106 | + if (!is_string($class)) { |
|
107 | 107 | $class = get_class($class); |
108 | 108 | } |
109 | 109 | |
110 | 110 | $traits = array_flip(class_uses_recursive($class)); |
111 | 111 | |
112 | - return isset($traits[$trait]); |
|
112 | + return isset($traits[ $trait ]); |
|
113 | 113 | } |
114 | 114 | } |
115 | -if (! function_exists('array_keys_exists')) { |
|
115 | +if (!function_exists('array_keys_exists')) { |
|
116 | 116 | function array_keys_exists(array $keys, array $arr) |
117 | 117 | { |
118 | - return ! array_diff_key(array_flip($keys), $arr); |
|
118 | + return !array_diff_key(array_flip($keys), $arr); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | -if (! function_exists('array_is_subset_of')) { |
|
122 | +if (!function_exists('array_is_subset_of')) { |
|
123 | 123 | function array_is_subset_of(array $subset, array $array, bool $strict = false) |
124 | 124 | { |
125 | 125 | $arrayAssociative = is_associative_array($array); |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | } |
136 | 136 | |
137 | 137 | return $result; |
138 | - } elseif (($subsetAssociative && ! $arrayAssociative) || |
|
139 | - (! $subsetAssociative && $arrayAssociative)) { |
|
138 | + } elseif (($subsetAssociative && !$arrayAssociative) || |
|
139 | + (!$subsetAssociative && $arrayAssociative)) { |
|
140 | 140 | return false; |
141 | 141 | } |
142 | 142 | |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | -if (! function_exists('is_associative_array')) { |
|
153 | +if (!function_exists('is_associative_array')) { |
|
154 | 154 | function is_associative_array(array $arr) |
155 | 155 | { |
156 | - if ([] === $arr) { |
|
156 | + if ([ ] === $arr) { |
|
157 | 157 | return false; |
158 | 158 | } |
159 | 159 | |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | -if (! function_exists('get_class_property')) { |
|
164 | +if (!function_exists('get_class_property')) { |
|
165 | 165 | function get_class_property($class, string $property) |
166 | 166 | { |
167 | - if (! is_string($class)) { |
|
167 | + if (!is_string($class)) { |
|
168 | 168 | $class = get_class($class); |
169 | 169 | } |
170 | 170 | |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | -if (! function_exists('instance_without_constructor')) { |
|
183 | +if (!function_exists('instance_without_constructor')) { |
|
184 | 184 | function instance_without_constructor($class) |
185 | 185 | { |
186 | - if (! is_string($class)) { |
|
186 | + if (!is_string($class)) { |
|
187 | 187 | $class = get_class($class); |
188 | 188 | } |
189 | 189 | |
@@ -200,17 +200,17 @@ discard block |
||
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
203 | -if (! function_exists('call_class_function')) { |
|
203 | +if (!function_exists('call_class_function')) { |
|
204 | 204 | function call_class_function($class, string $methodName) |
205 | 205 | { |
206 | 206 | return instance_without_constructor($class)->$methodName(); |
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
210 | -if (! function_exists('get_class_constants')) { |
|
210 | +if (!function_exists('get_class_constants')) { |
|
211 | 211 | function get_class_constants($class) |
212 | 212 | { |
213 | - if (! is_string($class)) { |
|
213 | + if (!is_string($class)) { |
|
214 | 214 | $class = get_class($class); |
215 | 215 | } |
216 | 216 |
@@ -26,6 +26,6 @@ |
||
26 | 26 | |
27 | 27 | public function decode() |
28 | 28 | { |
29 | - return json_decode($this->getContent(), true)['data'] ?? json_decode($this->getContent(), true); |
|
29 | + return json_decode($this->getContent(), true)[ 'data' ] ?? json_decode($this->getContent(), true); |
|
30 | 30 | } |
31 | 31 | } |