Passed
Branch master (94d85d)
by Php Easy Api
05:00 queued 02:03
created
src/resta/Foundation/Application.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 use Resta\Contracts\ApplicationHelpersContracts;
16 16
 use Resta\Foundation\Bootstrapper\Bootstrappers;
17 17
 
18
-class Application extends Kernel implements ApplicationContracts,ApplicationHelpersContracts
18
+class Application extends Kernel implements ApplicationContracts, ApplicationHelpersContracts
19 19
 {
20 20
     //get app paths
21 21
     use ApplicationPath;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      *
38 38
      * @param bool $console
39 39
      */
40
-    public function __construct($console=false)
40
+    public function __construct($console = false)
41 41
     {
42 42
         // get console status for cli
43 43
         $this->console = $console;
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
         // the booted objects are saved to the kernel.
59 59
         // this method checks whether these objects are registered.
60
-        return (isset($this['bindings'],$this['bindings'][$object]));
60
+        return (isset($this['bindings'], $this['bindings'][$object]));
61 61
     }
62 62
 
63 63
     /**
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         // taking care of the differences between operating system
77 77
         // and escaping arguments to prevent security issues.
78 78
         // It replaces PHP functions like exec, passthru, shell_exec and system
79
-        return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle();
79
+        return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle();
80 80
     }
81 81
 
82 82
     /**
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
      * @throws DependencyException
100 100
      * @throws NotFoundException
101 101
      */
102
-    public function config($config=null)
102
+    public function config($config = null)
103 103
     {
104
-        if($this->checkBindings(__FUNCTION__)){
104
+        if ($this->checkBindings(__FUNCTION__)) {
105 105
             return Config::make($config)->get();
106 106
         }
107 107
 
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
      * @param array $environment
143 143
      * @return mixed|string
144 144
      */
145
-    public function environment($environment=array())
145
+    public function environment($environment = array())
146 146
     {
147
-        if($this->checkBindings(__FUNCTION__)){
147
+        if ($this->checkBindings(__FUNCTION__)) {
148 148
 
149 149
             $arguments = (isset(func_get_args()[0]))
150 150
                 ? func_get_args()[0] : func_get_args();
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             $environmentContainer = $this['environment'];
154 154
 
155 155
             return $environmentContainer->environment(
156
-                $arguments,$this['environmentVariables']
156
+                $arguments, $this['environmentVariables']
157 157
             );
158 158
         }
159 159
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     public function isLocale() : bool
186 186
     {
187 187
         //check environment for local
188
-        return $this->environment() === 'local';
188
+        return $this->environment()==='local';
189 189
     }
190 190
 
191 191
     /**
@@ -199,14 +199,14 @@  discard block
 block discarded – undo
199 199
 
200 200
         // with the help of reflection instance,
201 201
         // we get the kernel properties extended with the application object.
202
-        foreach ($this['reflection']($this)->getProperties() as $property){
202
+        foreach ($this['reflection']($this)->getProperties() as $property) {
203 203
             $properties[] = $property->getName();
204 204
         }
205 205
 
206 206
         // we get the names of
207 207
         // the kernel properties ended with groups through the Collection class.
208
-        [$groups] = Collection::make($properties)->partition(function($properties){
209
-            return Str::endsWith($properties,'Groups');
208
+        [$groups] = Collection::make($properties)->partition(function($properties) {
209
+            return Str::endsWith($properties, 'Groups');
210 210
         });
211 211
 
212 212
         //as a result, kernel groups are being returned.
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
         $list = [];
224 224
 
225 225
         //get kernel group names with manifest method
226
-        foreach ($this->kernelGroupKeys() as $groupKey){
227
-            $list = array_merge($list,$this->manifest($groupKey));
226
+        foreach ($this->kernelGroupKeys() as $groupKey) {
227
+            $list = array_merge($list, $this->manifest($groupKey));
228 228
         }
229 229
 
230 230
         return $list;
@@ -240,10 +240,10 @@  discard block
 block discarded – undo
240 240
     {
241 241
         // it adds the values in path data specified
242 242
         // by callback to the configuration values.
243
-        if($this['config'] instanceof ConfigProviderContracts){
243
+        if ($this['config'] instanceof ConfigProviderContracts) {
244 244
 
245 245
             //set your path for config loader
246
-            return tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
246
+            return tap($this['config'], function(ConfigProviderContracts $config) use($callback) {
247 247
                 return $config->setConfig(call_user_func($callback));
248 248
             });
249 249
         }
@@ -258,19 +258,19 @@  discard block
 block discarded – undo
258 258
      * @param array $loaders
259 259
      * @return mixed|void
260 260
      */
261
-    public function loadIfNotExistBoot($loaders=array())
261
+    public function loadIfNotExistBoot($loaders = array())
262 262
     {
263 263
         //get kernel group list from application
264 264
         $kernelGroupList = $this->kernelGroupList();
265 265
 
266
-        foreach ($loaders as $loader){
266
+        foreach ($loaders as $loader) {
267 267
 
268 268
             // if a service needs another boot service,
269 269
             // the service is directly installed here and the service needs are resolved.
270
-            if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){
270
+            if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) {
271 271
 
272 272
                 //with the boot loader kernel,we get the boot loader method.
273
-                $this['closureBootLoader']->call(function() use($loader,$kernelGroupList) {
273
+                $this['closureBootLoader']->call(function() use($loader, $kernelGroupList) {
274 274
                     $this->bootstrapper = $kernelGroupList[$loader];
275 275
                     return $this->boot();
276 276
                 });
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     public function manifest($maker)
288 288
     {
289 289
         //kernel manifest bootstrapper
290
-        return $this['bootstrapper']->bootFire(null,$maker);
290
+        return $this['bootstrapper']->bootFire(null, $maker);
291 291
     }
292 292
 
293 293
     /**
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     public function runningInConsole() : bool
299 299
     {
300 300
         //Determine if the application is running in the console.
301
-        return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg';
301
+        return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg';
302 302
     }
303 303
 
304 304
     /**
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             : [];
315 315
 
316 316
         //core kernel providers and project providers have been merged
317
-        return array_merge($this->manifest('providers'),$providers);
317
+        return array_merge($this->manifest('providers'), $providers);
318 318
     }
319 319
 
320 320
     /**
@@ -324,12 +324,12 @@  discard block
 block discarded – undo
324 324
      * @param null $path
325 325
      * @return mixed|void
326 326
      */
327
-    public function setPaths($name=null,$path=null)
327
+    public function setPaths($name = null, $path = null)
328 328
     {
329 329
         // save the globally identified paths to
330 330
         // the global container object of the resta.
331
-        if(!is_null($name) && !is_null($path) && file_exists($path)){
332
-            $this->register('paths',$name,$path);
331
+        if (!is_null($name) && !is_null($path) && file_exists($path)) {
332
+            $this->register('paths', $name, $path);
333 333
         }
334 334
     }
335 335
 
Please login to merge, or discard this patch.
src/resta/Contracts/ApplicationContracts.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,45 +31,45 @@  discard block
 block discarded – undo
31 31
     /**
32 32
      * @return mixed
33 33
      */
34
-   public function console();
34
+    public function console();
35 35
 
36 36
     /**
37 37
      * @return mixed
38 38
      */
39
-   public function corePath();
39
+    public function corePath();
40 40
 
41 41
     /**
42 42
      * @param array $environment
43 43
      * @return mixed
44 44
      */
45
-   public function environment($environment=array());
45
+    public function environment($environment=array());
46 46
 
47 47
     /**
48 48
      * @return mixed
49 49
      */
50
-   public function handle();
50
+    public function handle();
51 51
 
52 52
     /**
53 53
      * @param $abstract
54 54
      * @param $instance
55 55
      * @return mixed
56 56
      */
57
-   public function instance ($abstract,$instance);
57
+    public function instance ($abstract,$instance);
58 58
 
59 59
     /**
60 60
      * @return mixed
61 61
      */
62
-   public function isLocale();
62
+    public function isLocale();
63 63
 
64 64
     /**
65 65
      * @return array
66 66
      */
67
-   public function kernelGroupKeys();
67
+    public function kernelGroupKeys();
68 68
 
69 69
     /**
70 70
      * @return array
71 71
      */
72
-   public function kernelGroupList();
72
+    public function kernelGroupList();
73 73
 
74 74
     /**
75 75
      * @param callable $callback
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
      * @param null $path
113 113
      * @return mixed
114 114
      */
115
-   public function setPaths($name=null,$path=null);
115
+    public function setPaths($name=null,$path=null);
116 116
 
117 117
     /**
118 118
      * @return mixed
119 119
      */
120
-   public function version();
120
+    public function version();
121 121
 
122 122
 }
123 123
\ No newline at end of file
Please login to merge, or discard this patch.