Passed
Push — master ( 521a09...61d0a0 )
by Php Easy Api
02:47
created
src/resta/Foundation/Application.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @param bool $console
40 40
      */
41
-    public function __construct($console=false)
41
+    public function __construct($console = false)
42 42
     {
43 43
         // get console status for cli
44 44
         $this->console = $console;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         // the booted objects are saved to the kernel.
60 60
         // this method checks whether these objects are registered.
61
-        return (isset($this['bindings'],$this['bindings'][$object]));
61
+        return (isset($this['bindings'], $this['bindings'][$object]));
62 62
     }
63 63
 
64 64
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         // taking care of the differences between operating system
78 78
         // and escaping arguments to prevent security issues.
79 79
         // It replaces PHP functions like exec, passthru, shell_exec and system
80
-        return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle();
80
+        return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle();
81 81
     }
82 82
 
83 83
     /**
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public function config($config)
104 104
     {
105
-        if($this->checkBindings(__FUNCTION__)){
105
+        if ($this->checkBindings(__FUNCTION__)) {
106 106
             return Config::make($config)->get();
107 107
         }
108 108
 
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
      * @param array $environment
144 144
      * @return mixed|string
145 145
      */
146
-    public function environment($environment=array())
146
+    public function environment($environment = array())
147 147
     {
148
-        if($this->checkBindings(__FUNCTION__)){
148
+        if ($this->checkBindings(__FUNCTION__)) {
149 149
 
150 150
             $arguments = (isset(func_get_args()[0]))
151 151
                 ? func_get_args()[0] : func_get_args();
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             $environmentContainer = $this['environment'];
155 155
 
156 156
             return $environmentContainer->environment(
157
-                $arguments,$this['environmentVariables']
157
+                $arguments, $this['environmentVariables']
158 158
             );
159 159
         }
160 160
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     public function isLocale() : bool
187 187
     {
188 188
         //check environment for local
189
-        return $this->environment() === 'local';
189
+        return $this->environment()==='local';
190 190
     }
191 191
 
192 192
     /**
@@ -200,14 +200,14 @@  discard block
 block discarded – undo
200 200
 
201 201
         // with the help of reflection instance,
202 202
         // we get the kernel properties extended with the application object.
203
-        foreach ($this['reflection']($this)->getProperties() as $property){
203
+        foreach ($this['reflection']($this)->getProperties() as $property) {
204 204
             $properties[] = $property->getName();
205 205
         }
206 206
 
207 207
         // we get the names of
208 208
         // the kernel properties ended with groups through the Collection class.
209
-        [$groups] = Collection::make($properties)->partition(function($properties){
210
-            return Str::endsWith($properties,'Groups');
209
+        [$groups] = Collection::make($properties)->partition(function($properties) {
210
+            return Str::endsWith($properties, 'Groups');
211 211
         });
212 212
 
213 213
         //as a result, kernel groups are being returned.
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
         $list = [];
225 225
 
226 226
         //get kernel group names with manifest method
227
-        foreach ($this->kernelGroupKeys() as $groupKey){
228
-            $list = array_merge($list,$this->manifest($groupKey));
227
+        foreach ($this->kernelGroupKeys() as $groupKey) {
228
+            $list = array_merge($list, $this->manifest($groupKey));
229 229
         }
230 230
 
231 231
         return $list;
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
     {
242 242
         // it adds the values in path data specified
243 243
         // by callback to the configuration values.
244
-        if($this['config'] instanceof ConfigProviderContracts){
244
+        if ($this['config'] instanceof ConfigProviderContracts) {
245 245
 
246 246
             //set your path for config loader
247
-            return tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
247
+            return tap($this['config'], function(ConfigProviderContracts $config) use($callback) {
248 248
                 return $config->setConfig(call_user_func($callback));
249 249
             });
250 250
         }
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
      * @param array $loaders
260 260
      * @return mixed|void
261 261
      */
262
-    public function loadIfNotExistBoot($loaders=array())
262
+    public function loadIfNotExistBoot($loaders = array())
263 263
     {
264 264
         //get kernel group list from application
265 265
         $kernelGroupList = $this->kernelGroupList();
@@ -267,14 +267,14 @@  discard block
 block discarded – undo
267 267
         /** @var ClosureDispatcherContracts $closureBootLoader */
268 268
         $closureBootLoader = $this['closureBootLoader'];
269 269
 
270
-        foreach ($loaders as $loader){
270
+        foreach ($loaders as $loader) {
271 271
 
272 272
             // if a service needs another boot service,
273 273
             // the service is directly installed here and the service needs are resolved.
274
-            if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){
274
+            if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) {
275 275
 
276 276
                 //with the boot loader kernel,we get the boot loader method.
277
-                $closureBootLoader->call(function() use($loader,$kernelGroupList) {
277
+                $closureBootLoader->call(function() use($loader, $kernelGroupList) {
278 278
 
279 279
                     /** @var BootLoader $bootLoader */
280 280
                     $bootLoader = $this;
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
         $bootstrapper = $this['bootstrapper'];
298 298
 
299 299
         //kernel manifest bootstrapper
300
-        return $bootstrapper->bootFire(null,$maker);
300
+        return $bootstrapper->bootFire(null, $maker);
301 301
     }
302 302
 
303 303
     /**
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     public function runningInConsole() : bool
309 309
     {
310 310
         //Determine if the application is running in the console.
311
-        return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
311
+        return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg';
312 312
     }
313 313
 
314 314
     /**
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             : [];
325 325
 
326 326
         //core kernel providers and project providers have been merged
327
-        return array_merge($this->manifest('providers'),$providers);
327
+        return array_merge($this->manifest('providers'), $providers);
328 328
     }
329 329
 
330 330
     /**
@@ -334,12 +334,12 @@  discard block
 block discarded – undo
334 334
      * @param string $path
335 335
      * @return mixed|void
336 336
      */
337
-    public function setPaths($name,$path)
337
+    public function setPaths($name, $path)
338 338
     {
339 339
         // save the globally identified paths to
340 340
         // the global container object of the resta.
341
-        if(file_exists($path)){
342
-            $this->register('paths',$name,$path);
341
+        if (file_exists($path)) {
342
+            $this->register('paths', $name, $path);
343 343
         }
344 344
     }
345 345
 
Please login to merge, or discard this patch.