@@ -33,9 +33,9 @@ |
||
33 | 33 | { |
34 | 34 | $inputs = $this->app->get($this->method); |
35 | 35 | |
36 | - $content = json_decode($this->app['request']->getContent(),1); |
|
36 | + $content = json_decode($this->app['request']->getContent(), 1); |
|
37 | 37 | |
38 | - if(is_array($inputs) && count($inputs)){ |
|
38 | + if (is_array($inputs) && count($inputs)) { |
|
39 | 39 | return $inputs; |
40 | 40 | } |
41 | 41 |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | |
49 | 49 | //Now, let's get our custom boot list. |
50 | 50 | //Let's assign the final state to our booterList list along with our custom boot list. |
51 | - foreach (array_keys($this->getBootDirectory()) as $customBoots){ |
|
51 | + foreach (array_keys($this->getBootDirectory()) as $customBoots) { |
|
52 | 52 | |
53 | 53 | //We assign the namespace data of the bootable class to the bootNamespace property. |
54 | - $this->bootNamespace=''.StaticPathList::$boot.'\\'.$customBoots; |
|
54 | + $this->bootNamespace = ''.StaticPathList::$boot.'\\'.$customBoots; |
|
55 | 55 | |
56 | 56 | //Your custom boot objects in |
57 | 57 | //the boot directory should not be in the middlewaregroups list. |
58 | - if(false===app()->console() && !in_array($this->bootNamespace,$booterList)){ |
|
58 | + if (false===app()->console() && !in_array($this->bootNamespace, $booterList)) { |
|
59 | 59 | $this->booterManifest(); |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | //The booterList property combines booterList variables. |
64 | - return array_merge($booterList,$this->booterList); |
|
64 | + return array_merge($booterList, $this->booterList); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | //if the boot list belongs to the custom booter, |
74 | 74 | //then we can boot our custom boot objects by adding them at the end of this class. |
75 | - if(array_pop($booter)==$this->customBooter){ |
|
75 | + if (array_pop($booter)==$this->customBooter) { |
|
76 | 76 | return $this->addCustomBooter(); |
77 | 77 | } |
78 | 78 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public static function clientVersion() |
22 | 22 | { |
23 | - if(defined('version')){ |
|
23 | + if (defined('version')) { |
|
24 | 24 | return version; |
25 | 25 | } |
26 | 26 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function getConsoleVersion() |
46 | 46 | { |
47 | - if(Utils::isNamespaceExists(self::versionNamespace()) && method_exists(self::versionNamespace(),'consoleVersion')){ |
|
47 | + if (Utils::isNamespaceExists(self::versionNamespace()) && method_exists(self::versionNamespace(), 'consoleVersion')) { |
|
48 | 48 | return self::versionNamespace()::consoleVersion(); |
49 | 49 | } |
50 | 50 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | * @param array $versions |
56 | 56 | * @return array |
57 | 57 | */ |
58 | - private static function getSupportedVersions($versions=array()) |
|
58 | + private static function getSupportedVersions($versions = array()) |
|
59 | 59 | { |
60 | - if(count($versions)){ |
|
60 | + if (count($versions)) { |
|
61 | 61 | return $versions; |
62 | 62 | } |
63 | 63 | return self::$supportedVersions; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array $versions |
70 | 70 | * @return mixed |
71 | 71 | */ |
72 | - public static function supportedVersions($versions=array()) |
|
72 | + public static function supportedVersions($versions = array()) |
|
73 | 73 | { |
74 | 74 | return self::versionNamespace()::getSupportedVersions($versions); |
75 | 75 | } |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function version() |
83 | 83 | { |
84 | - if(self::clientVersion()!==null){ |
|
84 | + if (self::clientVersion()!==null) { |
|
85 | 85 | return self::clientVersion(); |
86 | 86 | } |
87 | 87 | |
88 | - if(app()->console() && self::getConsoleVersion()!==null){ |
|
88 | + if (app()->console() && self::getConsoleVersion()!==null) { |
|
89 | 89 | return self::getConsoleVersion(); |
90 | 90 | } |
91 | 91 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public static function versionNamespace() |
101 | 101 | { |
102 | - if(file_exists(app()->path()->kernel())){ |
|
102 | + if (file_exists(app()->path()->kernel())) { |
|
103 | 103 | return app()->namespace()->kernel().'\Version'; |
104 | 104 | } |
105 | 105 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * LoggerHandler constructor. |
27 | 27 | * @param null $file |
28 | 28 | */ |
29 | - public function __construct($file=null) |
|
29 | + public function __construct($file = null) |
|
30 | 30 | { |
31 | 31 | $this->file = $file; |
32 | 32 | $this->logger = core()->loggerService; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function alert($message, array $context = []) |
53 | 53 | { |
54 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
54 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function critical($message, array $context = []) |
65 | 65 | { |
66 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
66 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function debug($message, array $context = []) |
77 | 77 | { |
78 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
78 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function emergency($message, array $context = []) |
89 | 89 | { |
90 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
90 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function error($message, array $context = []) |
101 | 101 | { |
102 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
102 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function info($message, array $context = []) |
113 | 113 | { |
114 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
114 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function notice($message, array $context = []) |
137 | 137 | { |
138 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
138 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function warning($message, array $context = []) |
149 | 149 | { |
150 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
150 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | * @param $context |
159 | 159 | * @return void |
160 | 160 | */ |
161 | - protected function writeLog($level, $message,$context) |
|
161 | + protected function writeLog($level, $message, $context) |
|
162 | 162 | { |
163 | 163 | $file = ($this->file===null) ? $level : $this->file; |
164 | 164 | |
165 | - if($this->adapter!==null){ |
|
165 | + if ($this->adapter!==null) { |
|
166 | 166 | |
167 | 167 | $adapter = $this->adapter; |
168 | 168 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | }); |
172 | 172 | } |
173 | 173 | |
174 | - if($this->logger!==null){ |
|
175 | - $this->logger->logHandler($message,$file,$level); |
|
174 | + if ($this->logger!==null) { |
|
175 | + $this->logger->logHandler($message, $file, $level); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return $context; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | // Use default autoload implementation |
32 | 32 | // Register given function as __autoload() implementation |
33 | - spl_autoload_register(function($class){ |
|
33 | + spl_autoload_register(function($class) { |
|
34 | 34 | $this->getRegisterCallBackVar($class); |
35 | 35 | $this->registerCallBackFormatter(); |
36 | 36 | }); |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | */ |
45 | 45 | private function getRegisterCallBackVar($class) :void |
46 | 46 | { |
47 | - if(defined('root')){ |
|
47 | + if (defined('root')) { |
|
48 | 48 | |
49 | 49 | $this->class = $class; |
50 | 50 | $this->classPath = root.''.DIRECTORY_SEPARATOR.''.$this->class.''.self::FileExtension; |
51 | - $this->classPath = str_replace("\\","/",$this->classPath); |
|
51 | + $this->classPath = str_replace("\\", "/", $this->classPath); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * |
58 | 58 | * return mixed |
59 | 59 | */ |
60 | - private function registerCallBackFormatter () |
|
60 | + private function registerCallBackFormatter() |
|
61 | 61 | { |
62 | - $this->checkAliasClassFormatter($this->classPath,function() { |
|
62 | + $this->checkAliasClassFormatter($this->classPath, function() { |
|
63 | 63 | require($this->classPath); |
64 | 64 | }); |
65 | 65 | } |
@@ -71,16 +71,16 @@ discard block |
||
71 | 71 | * @param $callback |
72 | 72 | * @return mixed |
73 | 73 | */ |
74 | - private function checkAliasClassFormatter($class,$callback) |
|
74 | + private function checkAliasClassFormatter($class, $callback) |
|
75 | 75 | { |
76 | 76 | $systemApp = []; |
77 | 77 | |
78 | - if(defined('app')){ |
|
78 | + if (defined('app')) { |
|
79 | 79 | $systemApp = (new ClassAliasGroup())->handle(); |
80 | 80 | } |
81 | 81 | |
82 | - if(!file_exists($class)){ |
|
83 | - $this->getAliasClassFormatter($class,$systemApp); |
|
82 | + if (!file_exists($class)) { |
|
83 | + $this->getAliasClassFormatter($class, $systemApp); |
|
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | * @param $class |
94 | 94 | * @param $systemApp |
95 | 95 | */ |
96 | - private function getAliasClassFormatter($class,$systemApp) |
|
96 | + private function getAliasClassFormatter($class, $systemApp) |
|
97 | 97 | { |
98 | - $this->setAliasClassGroup($class,$systemApp); |
|
98 | + $this->setAliasClassGroup($class, $systemApp); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -104,14 +104,14 @@ discard block |
||
104 | 104 | * @param $class |
105 | 105 | * @param $systemApp |
106 | 106 | */ |
107 | - private function setAliasClassGroup($class,$systemApp) |
|
107 | + private function setAliasClassGroup($class, $systemApp) |
|
108 | 108 | { |
109 | - $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'','',$class); |
|
110 | - $alias = str_replace(self::FileExtension,'',$alias); |
|
109 | + $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'', '', $class); |
|
110 | + $alias = str_replace(self::FileExtension, '', $alias); |
|
111 | 111 | |
112 | 112 | //set class_alias groups |
113 | - if(array_key_exists($alias,$systemApp)){ |
|
114 | - class_alias($systemApp[$alias],$alias); |
|
113 | + if (array_key_exists($alias, $systemApp)) { |
|
114 | + class_alias($systemApp[$alias], $alias); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -247,8 +247,7 @@ |
||
247 | 247 | tap($this['config'],function(ConfigProviderContracts $config) use($callback) { |
248 | 248 | $config->setConfig(call_user_func($callback)); |
249 | 249 | }); |
250 | - } |
|
251 | - else{ |
|
250 | + } else{ |
|
252 | 251 | //set config instance exception for application |
253 | 252 | exception()->unexpectedValue('config instance is not loaded for application container'); |
254 | 253 | } |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | * @param bool $console |
49 | 49 | * @param null $containerCacheFile |
50 | 50 | */ |
51 | - public function __construct($console=false,$containerCacheFile=null) |
|
51 | + public function __construct($console = false, $containerCacheFile = null) |
|
52 | 52 | { |
53 | 53 | //get console status for cli |
54 | 54 | $this->console = (is_bool($console)) ? $console : true; |
55 | 55 | |
56 | - if(!is_null($containerCacheFile)){ |
|
56 | + if (!is_null($containerCacheFile)) { |
|
57 | 57 | $this->containerCacheFile = $containerCacheFile; |
58 | 58 | } |
59 | 59 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | // the booted objects are saved to the kernel. |
74 | 74 | // this method checks whether these objects are registered. |
75 | - return (isset($this['bindings'],$this['bindings'][$object])); |
|
75 | + return (isset($this['bindings'], $this['bindings'][$object])); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // taking care of the differences between operating system |
89 | 89 | // and escaping arguments to prevent security issues. |
90 | 90 | // It replaces PHP functions like exec, passthru, shell_exec and system |
91 | - return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle(); |
|
91 | + return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function config($config) |
115 | 115 | { |
116 | - if($this->checkBindings(__FUNCTION__)){ |
|
116 | + if ($this->checkBindings(__FUNCTION__)) { |
|
117 | 117 | |
118 | 118 | /** @var Macro $macro */ |
119 | 119 | $macro = $this['macro']; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | // this includes the configuration macro class. |
122 | 122 | // therefore, you can expand your configuration settings from |
123 | 123 | // the application kernel identifier to the desired class. |
124 | - return $macro->withStatic(Config::macro(),function() use($config){ |
|
124 | + return $macro->withStatic(Config::macro(), function() use($config){ |
|
125 | 125 | return Config::make($config); |
126 | 126 | })->get(); |
127 | 127 | |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | { |
156 | 156 | // this is the method that allows container records |
157 | 157 | // to be written to a json file. |
158 | - if(!is_null($containerCacheFile = containerCacheFile())){ |
|
158 | + if (!is_null($containerCacheFile = containerCacheFile())) { |
|
159 | 159 | return $containerCacheFile; |
160 | 160 | } |
161 | 161 | |
162 | 162 | // if the container json file is null |
163 | 163 | // then a registered container value is assigned. |
164 | - if(!is_null($this->containerCacheFile)){ |
|
164 | + if (!is_null($this->containerCacheFile)) { |
|
165 | 165 | return $this->containerCacheFile; |
166 | 166 | } |
167 | 167 | |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | * @param array $environment |
187 | 187 | * @return mixed|string |
188 | 188 | */ |
189 | - public function environment($environment=array()) |
|
189 | + public function environment($environment = array()) |
|
190 | 190 | { |
191 | - if($this->checkBindings(__FUNCTION__)){ |
|
191 | + if ($this->checkBindings(__FUNCTION__)) { |
|
192 | 192 | |
193 | 193 | $arguments = (isset(func_get_args()[0])) |
194 | 194 | ? func_get_args()[0] : func_get_args(); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $environmentContainer = $this['environment']; |
198 | 198 | |
199 | 199 | return $environmentContainer->environment( |
200 | - $arguments,$this['environmentVariables'] |
|
200 | + $arguments, $this['environmentVariables'] |
|
201 | 201 | ); |
202 | 202 | } |
203 | 203 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | public function isLocale() : bool |
230 | 230 | { |
231 | 231 | //check environment for local |
232 | - return $this->environment() === 'local'; |
|
232 | + return $this->environment()==='local'; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -243,14 +243,14 @@ discard block |
||
243 | 243 | |
244 | 244 | // with the help of reflection instance, |
245 | 245 | // we get the kernel properties extended with the application object. |
246 | - foreach ($this['reflection']($this)->getProperties() as $property){ |
|
246 | + foreach ($this['reflection']($this)->getProperties() as $property) { |
|
247 | 247 | $properties[] = $property->getName(); |
248 | 248 | } |
249 | 249 | |
250 | 250 | // we get the names of |
251 | 251 | // the kernel properties ended with groups through the Collection class. |
252 | - [$groups] = Collection::make($properties)->partition(function($properties){ |
|
253 | - return Str::endsWith($properties,'Groups'); |
|
252 | + [$groups] = Collection::make($properties)->partition(function($properties) { |
|
253 | + return Str::endsWith($properties, 'Groups'); |
|
254 | 254 | }); |
255 | 255 | |
256 | 256 | //as a result, kernel groups are being returned. |
@@ -267,8 +267,8 @@ discard block |
||
267 | 267 | $list = []; |
268 | 268 | |
269 | 269 | //get kernel group names with manifest method |
270 | - foreach ($this->kernelGroupKeys() as $groupKey){ |
|
271 | - $list = array_merge($list,$this->manifest($groupKey)); |
|
270 | + foreach ($this->kernelGroupKeys() as $groupKey) { |
|
271 | + $list = array_merge($list, $this->manifest($groupKey)); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | return $list; |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | { |
285 | 285 | // it adds the values in path data specified |
286 | 286 | // by callback to the configuration values. |
287 | - if($this['config'] instanceof ConfigProviderContracts){ |
|
287 | + if ($this['config'] instanceof ConfigProviderContracts) { |
|
288 | 288 | |
289 | 289 | //set your path for config loader |
290 | - tap($this['config'],function(ConfigProviderContracts $config) use($callback) { |
|
290 | + tap($this['config'], function(ConfigProviderContracts $config) use($callback) { |
|
291 | 291 | $config->setConfig(call_user_func($callback)); |
292 | 292 | }); |
293 | 293 | } |
294 | - else{ |
|
294 | + else { |
|
295 | 295 | //set config instance exception for application |
296 | 296 | exception()->unexpectedValue('config instance is not loaded for application container'); |
297 | 297 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * @param array $loaders |
304 | 304 | * @return mixed|void |
305 | 305 | */ |
306 | - public function loadIfNotExistBoot($loaders=array()) |
|
306 | + public function loadIfNotExistBoot($loaders = array()) |
|
307 | 307 | { |
308 | 308 | //get kernel group list from application |
309 | 309 | $kernelGroupList = $this->kernelGroupList(); |
@@ -311,14 +311,14 @@ discard block |
||
311 | 311 | /** @var ClosureDispatcherContracts $closureBootLoader */ |
312 | 312 | $closureBootLoader = $this['closureBootLoader']; |
313 | 313 | |
314 | - foreach ($loaders as $loader){ |
|
314 | + foreach ($loaders as $loader) { |
|
315 | 315 | |
316 | 316 | // if a service needs another boot service, |
317 | 317 | // the service is directly installed here and the service needs are resolved. |
318 | - if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){ |
|
318 | + if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) { |
|
319 | 319 | |
320 | 320 | //with the boot loader kernel,we get the boot loader method. |
321 | - $closureBootLoader->call(function() use($loader,$kernelGroupList) { |
|
321 | + $closureBootLoader->call(function() use($loader, $kernelGroupList) { |
|
322 | 322 | |
323 | 323 | /** @var BootLoader $bootLoader */ |
324 | 324 | $bootLoader = $this; |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | $bootstrapper = $this['bootstrapper']; |
342 | 342 | |
343 | 343 | //kernel manifest bootstrapper |
344 | - return $bootstrapper->bootFire(null,$maker); |
|
344 | + return $bootstrapper->bootFire(null, $maker); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | /** |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | public function runningInConsole() : bool |
353 | 353 | { |
354 | 354 | //Determine if the application is running in the console. |
355 | - return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; |
|
355 | + return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg'; |
|
356 | 356 | } |
357 | 357 | |
358 | 358 | /** |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | : []; |
369 | 369 | |
370 | 370 | //core kernel providers and project providers have been merged |
371 | - return array_merge($this->manifest('providers'),$providers); |
|
371 | + return array_merge($this->manifest('providers'), $providers); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | /** |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | * @param string $path |
379 | 379 | * @return mixed|void |
380 | 380 | */ |
381 | - public function setPaths($name,$path) |
|
381 | + public function setPaths($name, $path) |
|
382 | 382 | { |
383 | 383 | // save the globally identified paths to |
384 | 384 | // the global container object of the resta. |
385 | - if(file_exists($path)){ |
|
386 | - $this->register('paths',$name,$path); |
|
385 | + if (file_exists($path)) { |
|
386 | + $this->register('paths', $name, $path); |
|
387 | 387 | } |
388 | 388 | } |
389 | 389 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | (new BaseRegister($this->app))->handle(); |
42 | 42 | |
43 | 43 | //we save the bootstrapper class in container. |
44 | - $this->app->register('bootstrapper',$this); |
|
44 | + $this->app->register('bootstrapper', $this); |
|
45 | 45 | |
46 | 46 | //call bootstrapper process |
47 | 47 | $this->callBootstrapperProcess(); |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | { |
60 | 60 | //The boot method to be executed can be specified by the user. |
61 | 61 | //We use this method to know how to customize it. |
62 | - BootFireCallback::setBootFire([$this->app,$bootstrapper],function($boot){ |
|
62 | + BootFireCallback::setBootFire([$this->app, $bootstrapper], function($boot) { |
|
63 | 63 | |
64 | 64 | //kernel boots run and service container |
65 | 65 | //makeBuild for service Container |
66 | - $this->bootFire($boot,null); |
|
66 | + $this->bootFire($boot, null); |
|
67 | 67 | }); |
68 | 68 | } |
69 | 69 | |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | * @param string $maker |
75 | 75 | * @return mixed |
76 | 76 | */ |
77 | - public function bootFire($boot,$maker) |
|
77 | + public function bootFire($boot, $maker) |
|
78 | 78 | { |
79 | 79 | // we can refer to this method |
80 | 80 | // because we can boot classes in the middleware or bootstrapper array. |
81 | - if(is_null($boot) && !is_null($maker)){ |
|
81 | + if (is_null($boot) && !is_null($maker)) { |
|
82 | 82 | |
83 | 83 | /** @var KernelManifestManager $kernelManifestBind */ |
84 | 84 | $kernelManifestBind = $this->app->resolve(KernelManifestManager::class); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | // the boot method to be executed can be specified by the user. |
92 | 92 | // we use this method to know how to customize it. |
93 | - return forward_static_call_array([array_pop($boot),self::LOADBOOTSTRAPPERS],[$boot]); |
|
93 | + return forward_static_call_array([array_pop($boot), self::LOADBOOTSTRAPPERS], [$boot]); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | */ |
102 | 102 | private function bootstrapper(...$params) |
103 | 103 | { |
104 | - [$group,$booting,$onion] = $params; |
|
104 | + [$group, $booting, $onion] = $params; |
|
105 | 105 | |
106 | - if($onion){ |
|
106 | + if ($onion) { |
|
107 | 107 | |
108 | 108 | // we will implement a special onion method here and |
109 | 109 | // pass our bootstraper classes through this method. |
110 | 110 | // Our goal here is to implement the middleware layer correctly. |
111 | - $this->app->resolve(MiddlewareKernelProvider::class)->onionBoot([$group,$booting],function() use($group){ |
|
111 | + $this->app->resolve(MiddlewareKernelProvider::class)->onionBoot([$group, $booting], function() use($group){ |
|
112 | 112 | $this->boot($group); |
113 | 113 | }); |
114 | 114 | |
@@ -125,18 +125,18 @@ discard block |
||
125 | 125 | * |
126 | 126 | * @param array $customBootstrapers |
127 | 127 | */ |
128 | - public function callBootstrapperProcess($customBootstrapers=[]) |
|
128 | + public function callBootstrapperProcess($customBootstrapers = []) |
|
129 | 129 | { |
130 | 130 | // here we check that a special bootstrappers list will work and we identify the onion identifier. |
131 | 131 | // we are peeling onion class by classifying onion class. |
132 | 132 | $this->getBootstrappersStack($customBootstrapers); |
133 | 133 | |
134 | 134 | //We run the bootstrap list by callback with the object specified for the content respectively. |
135 | - foreach($this->stack['getBootstrappers'] as $bootstrapper){ |
|
135 | + foreach ($this->stack['getBootstrappers'] as $bootstrapper) { |
|
136 | 136 | |
137 | 137 | // if the callback data is different from the application kernel, |
138 | 138 | // we will pass it to the pusher control for a special use. |
139 | - call_user_func_array([$this,'bootstrapper'],[$bootstrapper,$this,$this->stack['onionIdentifier']]); |
|
139 | + call_user_func_array([$this, 'bootstrapper'], [$bootstrapper, $this, $this->stack['onionIdentifier']]); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | private function peelings() |
163 | 163 | { |
164 | 164 | //if there are peelings |
165 | - if(isset($this->app['peelings'])){ |
|
165 | + if (isset($this->app['peelings'])) { |
|
166 | 166 | |
167 | 167 | // We send the peelings property to |
168 | 168 | // the bootstrapperPeelOnion class. |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @param ApplicationContracts $app |
21 | 21 | * @param array $boot |
22 | 22 | */ |
23 | - public function __construct($app,$boot=array()) |
|
23 | + public function __construct($app, $boot = array()) |
|
24 | 24 | { |
25 | 25 | parent::__construct($app); |
26 | 26 | |
@@ -35,21 +35,21 @@ discard block |
||
35 | 35 | * @param array $boots |
36 | 36 | * @param bool $defaultBoot |
37 | 37 | */ |
38 | - private function bootstrapper($boots=array(),$defaultBoot=true) |
|
38 | + private function bootstrapper($boots = array(), $defaultBoot = true) |
|
39 | 39 | { |
40 | 40 | //boot loop make bind calling |
41 | - foreach ($boots as $bootstrapper){ |
|
41 | + foreach ($boots as $bootstrapper) { |
|
42 | 42 | |
43 | 43 | // for the default boot, we overwrite the bootstrapper class's bootstrapper property |
44 | 44 | // and load it with the boot method. |
45 | - if($defaultBoot){ |
|
45 | + if ($defaultBoot) { |
|
46 | 46 | $this->app->loadIfNotExistBoot([$bootstrapper]); |
47 | 47 | } |
48 | 48 | // we will use the classical method for classes |
49 | 49 | // that will not boot from the kernel. |
50 | - else{ |
|
51 | - if(Utils::isNamespaceExists($bootstrapper) |
|
52 | - && false===isset($this->app['resolve'][$bootstrapper])){ |
|
50 | + else { |
|
51 | + if (Utils::isNamespaceExists($bootstrapper) |
|
52 | + && false===isset($this->app['resolve'][$bootstrapper])) { |
|
53 | 53 | $this->app->resolve($bootstrapper)->boot(); |
54 | 54 | } |
55 | 55 | } |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | private function customBootManifest(callable $callback) |
66 | 66 | { |
67 | 67 | //we make custom boot |
68 | - if(isset($this->boot['custom'])){ |
|
69 | - return call_user_func_array($callback,[$this->boot['custom']]); |
|
68 | + if (isset($this->boot['custom'])) { |
|
69 | + return call_user_func_array($callback, [$this->boot['custom']]); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | $defaultBoot = Collection::make($this->boot)->except('custom')->all(); |
82 | 82 | |
83 | 83 | //custom boot according to manifest bootManager |
84 | - $this->customBootManifest(function($boot){ |
|
85 | - $this->bootstrapper((array)$boot,false); |
|
84 | + $this->customBootManifest(function($boot) { |
|
85 | + $this->bootstrapper((array)$boot, false); |
|
86 | 86 | }); |
87 | 87 | |
88 | 88 | // and as a result we now use |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @param $key |
23 | 23 | * @return mixed |
24 | 24 | */ |
25 | - abstract function annotation($method,$key); |
|
25 | + abstract function annotation($method, $key); |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * get input values from request object |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @param $reflection |
54 | 54 | */ |
55 | - public function setReflection($reflection){ |
|
55 | + public function setReflection($reflection) { |
|
56 | 56 | |
57 | 57 | $this->request = ClosureDispatcher::bind($reflection); |
58 | 58 | } |