@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @param bool $console |
41 | 41 | */ |
42 | - public function __construct($console=false) |
|
42 | + public function __construct($console = false) |
|
43 | 43 | { |
44 | 44 | //get console status for cli |
45 | 45 | $this->console = (is_bool($console)) ? $console : true; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | // the booted objects are saved to the kernel. |
61 | 61 | // this method checks whether these objects are registered. |
62 | - return (isset($this['bindings'],$this['bindings'][$object])); |
|
62 | + return (isset($this['bindings'], $this['bindings'][$object])); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | // taking care of the differences between operating system |
76 | 76 | // and escaping arguments to prevent security issues. |
77 | 77 | // It replaces PHP functions like exec, passthru, shell_exec and system |
78 | - return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle(); |
|
78 | + return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle(); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function config($config) |
102 | 102 | { |
103 | - if($this->checkBindings(__FUNCTION__)){ |
|
103 | + if ($this->checkBindings(__FUNCTION__)) { |
|
104 | 104 | |
105 | 105 | /** @var Macro $macro */ |
106 | 106 | $macro = $this['macro']; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | // this includes the configuration macro class. |
109 | 109 | // therefore, you can expand your configuration settings from |
110 | 110 | // the application kernel identifier to the desired class. |
111 | - return $macro->withStatic(Config::macro(),function() use($config){ |
|
111 | + return $macro->withStatic(Config::macro(), function() use($config){ |
|
112 | 112 | return Config::make($config); |
113 | 113 | })->get(); |
114 | 114 | |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | * @param array $environment |
152 | 152 | * @return mixed|string |
153 | 153 | */ |
154 | - public function environment($environment=array()) |
|
154 | + public function environment($environment = array()) |
|
155 | 155 | { |
156 | - if($this->checkBindings(__FUNCTION__)){ |
|
156 | + if ($this->checkBindings(__FUNCTION__)) { |
|
157 | 157 | |
158 | 158 | $arguments = (isset(func_get_args()[0])) |
159 | 159 | ? func_get_args()[0] : func_get_args(); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $environmentContainer = $this['environment']; |
163 | 163 | |
164 | 164 | return $environmentContainer->environment( |
165 | - $arguments,$this['environmentVariables'] |
|
165 | + $arguments, $this['environmentVariables'] |
|
166 | 166 | ); |
167 | 167 | } |
168 | 168 | |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | public function isLocale() : bool |
195 | 195 | { |
196 | 196 | //check environment for local |
197 | - return $this->environment() === 'local'; |
|
197 | + return $this->environment()==='local'; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -208,14 +208,14 @@ discard block |
||
208 | 208 | |
209 | 209 | // with the help of reflection instance, |
210 | 210 | // we get the kernel properties extended with the application object. |
211 | - foreach ($this['reflection']($this)->getProperties() as $property){ |
|
211 | + foreach ($this['reflection']($this)->getProperties() as $property) { |
|
212 | 212 | $properties[] = $property->getName(); |
213 | 213 | } |
214 | 214 | |
215 | 215 | // we get the names of |
216 | 216 | // the kernel properties ended with groups through the Collection class. |
217 | - [$groups] = Collection::make($properties)->partition(function($properties){ |
|
218 | - return Str::endsWith($properties,'Groups'); |
|
217 | + [$groups] = Collection::make($properties)->partition(function($properties) { |
|
218 | + return Str::endsWith($properties, 'Groups'); |
|
219 | 219 | }); |
220 | 220 | |
221 | 221 | //as a result, kernel groups are being returned. |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | $list = []; |
233 | 233 | |
234 | 234 | //get kernel group names with manifest method |
235 | - foreach ($this->kernelGroupKeys() as $groupKey){ |
|
236 | - $list = array_merge($list,$this->manifest($groupKey)); |
|
235 | + foreach ($this->kernelGroupKeys() as $groupKey) { |
|
236 | + $list = array_merge($list, $this->manifest($groupKey)); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | return $list; |
@@ -249,14 +249,14 @@ discard block |
||
249 | 249 | { |
250 | 250 | // it adds the values in path data specified |
251 | 251 | // by callback to the configuration values. |
252 | - if($this['config'] instanceof ConfigProviderContracts){ |
|
252 | + if ($this['config'] instanceof ConfigProviderContracts) { |
|
253 | 253 | |
254 | 254 | //set your path for config loader |
255 | - tap($this['config'],function(ConfigProviderContracts $config) use($callback) { |
|
255 | + tap($this['config'], function(ConfigProviderContracts $config) use($callback) { |
|
256 | 256 | $config->setConfig(call_user_func($callback)); |
257 | 257 | }); |
258 | 258 | } |
259 | - else{ |
|
259 | + else { |
|
260 | 260 | //set config instance exception for application |
261 | 261 | exception()->unexpectedValue('config instance is not loaded for application container'); |
262 | 262 | } |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | * @param array $loaders |
269 | 269 | * @return mixed|void |
270 | 270 | */ |
271 | - public function loadIfNotExistBoot($loaders=array()) |
|
271 | + public function loadIfNotExistBoot($loaders = array()) |
|
272 | 272 | { |
273 | 273 | //get kernel group list from application |
274 | 274 | $kernelGroupList = $this->kernelGroupList(); |
@@ -276,14 +276,14 @@ discard block |
||
276 | 276 | /** @var ClosureDispatcherContracts $closureBootLoader */ |
277 | 277 | $closureBootLoader = $this['closureBootLoader']; |
278 | 278 | |
279 | - foreach ($loaders as $loader){ |
|
279 | + foreach ($loaders as $loader) { |
|
280 | 280 | |
281 | 281 | // if a service needs another boot service, |
282 | 282 | // the service is directly installed here and the service needs are resolved. |
283 | - if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){ |
|
283 | + if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) { |
|
284 | 284 | |
285 | 285 | //with the boot loader kernel,we get the boot loader method. |
286 | - $closureBootLoader->call(function() use($loader,$kernelGroupList) { |
|
286 | + $closureBootLoader->call(function() use($loader, $kernelGroupList) { |
|
287 | 287 | |
288 | 288 | /** @var BootLoader $bootLoader */ |
289 | 289 | $bootLoader = $this; |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $bootstrapper = $this['bootstrapper']; |
307 | 307 | |
308 | 308 | //kernel manifest bootstrapper |
309 | - return $bootstrapper->bootFire(null,$maker); |
|
309 | + return $bootstrapper->bootFire(null, $maker); |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | public function runningInConsole() : bool |
318 | 318 | { |
319 | 319 | //Determine if the application is running in the console. |
320 | - return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; |
|
320 | + return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg'; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | : []; |
334 | 334 | |
335 | 335 | //core kernel providers and project providers have been merged |
336 | - return array_merge($this->manifest('providers'),$providers); |
|
336 | + return array_merge($this->manifest('providers'), $providers); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | /** |
@@ -343,12 +343,12 @@ discard block |
||
343 | 343 | * @param string $path |
344 | 344 | * @return mixed|void |
345 | 345 | */ |
346 | - public function setPaths($name,$path) |
|
346 | + public function setPaths($name, $path) |
|
347 | 347 | { |
348 | 348 | // save the globally identified paths to |
349 | 349 | // the global container object of the resta. |
350 | - if(file_exists($path)){ |
|
351 | - $this->register('paths',$name,$path); |
|
350 | + if (file_exists($path)) { |
|
351 | + $this->register('paths', $name, $path); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 |