Test Failed
Push — master ( 878578...37e8ab )
by Php Easy Api
07:30
created
src/resta/Router/Route.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -203,8 +203,7 @@
 block discarded – undo
203 203
                 if(file_exists($routeMapper) && !isset(static::$paths[$routeMapper])){
204 204
                     static::$paths[$routeMapper] = $routeDefinitor['controllerPath'];
205 205
                 }
206
-            }
207
-            else{
206
+            } else{
208 207
 
209 208
                 // if there is no endpoint,
210 209
                 // all files in the path of the route are transferred to path.
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
      * @param $urlRoute
44 44
      * @return int|string
45 45
      */
46
-    public static function checkArrayEqual($patterns,$urlRoute)
46
+    public static function checkArrayEqual($patterns, $urlRoute)
47 47
     {
48 48
         // calculates the equality difference between
49 49
         // the route pattern and the urlRoute value.
50
-        foreach ($patterns as $key=>$pattern){
50
+        foreach ($patterns as $key=>$pattern) {
51 51
 
52
-            if(Utils::isArrayEqual($pattern,$urlRoute)){
52
+            if (Utils::isArrayEqual($pattern, $urlRoute)) {
53 53
                 return $key;
54 54
             }
55 55
         }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public static function getCallingRoute()
68 68
     {
69
-        if(app()->has('routeResolvedData')){
69
+        if (app()->has('routeResolvedData')) {
70 70
             return app()->get('routeResolvedData');
71 71
         }
72 72
         
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         $route = self::getRouteResolve();
84 84
 
85
-        if(isset($route['class'])){
85
+        if (isset($route['class'])) {
86 86
             return $route['class'];
87 87
         }
88 88
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     {
99 99
         $route = self::getRouteResolve();
100 100
 
101
-        if(isset($route['method'])){
101
+        if (isset($route['method'])) {
102 102
             return $route['method'];
103 103
         }
104 104
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $route = self::getRouteResolve();
116 116
 
117
-        if(isset($route['controller'],$route['namespace'])){
117
+        if (isset($route['controller'], $route['namespace'])) {
118 118
             return $route['controller'].'/'.$route['namespace'];
119 119
         }
120 120
 
@@ -131,17 +131,17 @@  discard block
 block discarded – undo
131 131
         // get routes data and the resolving pattern
132 132
         // Both are interrelated.
133 133
         $routes = self::getRoutes();
134
-        $patternResolve = app()->resolve(RouteMatching::class,['route'=>new self()])->getPatternResolve();
134
+        $patternResolve = app()->resolve(RouteMatching::class, ['route'=>new self()])->getPatternResolve();
135 135
 
136 136
         // we set the route variables for the route assistant.
137 137
         self::updateRouteParameters($patternResolve);
138 138
 
139 139
         //if routes data is available in pattern resolve.
140
-        if(isset($routes['data'][$patternResolve])){
140
+        if (isset($routes['data'][$patternResolve])) {
141 141
 
142 142
             // if the incoming http value is
143 143
             // the same as the real request method, the data is processed.
144
-            if($routes['data'][$patternResolve]['http'] == strtolower(httpMethod)){
144
+            if ($routes['data'][$patternResolve]['http']==strtolower(httpMethod)) {
145 145
 
146 146
                 // we are set the solved pattern to a variable.
147 147
                 $resolve = $routes['data'][$patternResolve];
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                     'http'          => httpMethod(),
155 155
                 ];
156 156
 
157
-                app()->register('routeResolvedData',$routeResolvedData);
157
+                app()->register('routeResolvedData', $routeResolvedData);
158 158
 
159 159
                 return $routeResolvedData;
160 160
             }
@@ -173,22 +173,22 @@  discard block
 block discarded – undo
173 173
     {
174 174
         $list = [];
175 175
 
176
-        if(isset(static::$routes['pattern'][$patternResolvedKey])){
176
+        if (isset(static::$routes['pattern'][$patternResolvedKey])) {
177 177
 
178 178
             $routeParameters = static::$routes['pattern'][$patternResolvedKey];
179 179
             $route = route();
180 180
 
181
-            foreach($routeParameters as $key=>$param){
181
+            foreach ($routeParameters as $key=>$param) {
182 182
 
183
-                $param = Str::replaceWordArray(['{','}','?'],'',$param);
183
+                $param = Str::replaceWordArray(['{', '}', '?'], '', $param);
184 184
 
185
-                if(isset($route[$key])){
185
+                if (isset($route[$key])) {
186 186
                     $list[$param] = $route[$key];
187 187
                 }
188 188
             }
189 189
         }
190 190
 
191
-        app()->register('routeParams',$list);
191
+        app()->register('routeParams', $list);
192 192
     }
193 193
 
194 194
     /**
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
      *
197 197
      * @param bool $endpoint
198 198
      */
199
-    public function handle($endpoint=true)
199
+    public function handle($endpoint = true)
200 200
     {
201 201
         // we will record the path data for the route.
202 202
         // We set the routeMapper variables and the route path.
203
-        self::setPath(function(){
203
+        self::setPath(function() {
204 204
 
205 205
             // we are sending
206 206
             // the controller and routes.php path.
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
         // in the paths data,
214 214
         // we run the route mapper values ​​and the route files one by one.
215
-        foreach (self::$paths as $mapper=>$controller){
215
+        foreach (self::$paths as $mapper=>$controller) {
216 216
             core()->fileSystem->callFile($mapper);
217 217
         }
218 218
     }
@@ -223,11 +223,11 @@  discard block
 block discarded – undo
223 223
      * @param callable $callback
224 224
      * @param bool $endpoint
225 225
      */
226
-    public static function setPath(callable $callback,$endpoint=true)
226
+    public static function setPath(callable $callback, $endpoint = true)
227 227
     {
228 228
         $routeDefinitor = call_user_func($callback);
229 229
 
230
-        if(isset($routeDefinitor['controllerPath']) && isset($routeDefinitor['routePath'])){
230
+        if (isset($routeDefinitor['controllerPath']) && isset($routeDefinitor['routePath'])) {
231 231
 
232 232
             //the route paths to be saved to the mappers static property.
233 233
             static::$mappers['routePaths'][] = $routeDefinitor['routePath'];
@@ -235,22 +235,22 @@  discard block
 block discarded – undo
235 235
 
236 236
             // if there is endpoint,
237 237
             // then only that endpoint is transferred into the path
238
-            if(defined('endpoint') && $endpoint){
238
+            if (defined('endpoint') && $endpoint) {
239 239
 
240 240
                 $routeName      = endpoint.'Route.php';
241 241
                 $routeMapper    = $routeDefinitor['routePath'].''.DIRECTORY_SEPARATOR.''.$routeName;
242 242
 
243
-                if(file_exists($routeMapper) && !isset(static::$paths[$routeMapper])){
243
+                if (file_exists($routeMapper) && !isset(static::$paths[$routeMapper])) {
244 244
                     static::$paths[$routeMapper] = $routeDefinitor['controllerPath'];
245 245
                 }
246 246
             }
247
-            else{
247
+            else {
248 248
 
249 249
                 // if there is no endpoint,
250 250
                 // all files in the path of the route are transferred to path.
251 251
                 $allFilesInThatRoutePath = Utils::glob($routeDefinitor['routePath']);
252 252
 
253
-                foreach ($allFilesInThatRoutePath as $item){
253
+                foreach ($allFilesInThatRoutePath as $item) {
254 254
                     static::$paths[$item] = $routeDefinitor['controllerPath'];
255 255
                 }
256 256
             }
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
      * @param $function
265 265
      * @param null $controller
266 266
      */
267
-    public static function setRoute($params,$function,$controller=null)
267
+    public static function setRoute($params, $function, $controller = null)
268 268
     {
269
-        [$pattern,$route]   = $params;
270
-        [$class,$method]    = explode("@",$route);
269
+        [$pattern, $route]   = $params;
270
+        [$class, $method]    = explode("@", $route);
271 271
 
272 272
         $patternList = array_values(
273
-            array_filter(explode("/",$pattern),'strlen')
273
+            array_filter(explode("/", $pattern), 'strlen')
274 274
         );
275 275
 
276 276
         static::$routes['pattern'][] = $patternList;
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             'http'          => $function,
281 281
             'controller'    => $controller,
282 282
             'namespace'     => static::$namespace,
283
-            'endpoint'      => strtolower(str_replace(StaticPathList::$controllerBundleName,'',static::$namespace))
283
+            'endpoint'      => strtolower(str_replace(StaticPathList::$controllerBundleName, '', static::$namespace))
284 284
         ];
285 285
     }
286 286
 
@@ -290,11 +290,11 @@  discard block
 block discarded – undo
290 290
      * @param null $value
291 291
      * @return bool
292 292
      */
293
-    public static function isMatchVaribleRegexPattern($value=null)
293
+    public static function isMatchVaribleRegexPattern($value = null)
294 294
     {
295 295
         // determines if the variable that can be used
296 296
         // in the route file meets the regex rule.
297
-        return (preg_match('@\{(.*?)\}@is',$value)) ? true : false;
297
+        return (preg_match('@\{(.*?)\}@is', $value)) ? true : false;
298 298
     }
299 299
 
300 300
 
@@ -304,11 +304,11 @@  discard block
 block discarded – undo
304 304
      * @param null $value
305 305
      * @return bool
306 306
      */
307
-    public static function isOptionalVaribleRegexPattern($value=null)
307
+    public static function isOptionalVaribleRegexPattern($value = null)
308 308
     {
309 309
         // determines if the variable that can be used
310 310
         // in the route file meets the regex rule.
311
-        return preg_match('@\{[a-z]+\?\}@is',$value) ? true : false;
311
+        return preg_match('@\{[a-z]+\?\}@is', $value) ? true : false;
312 312
     }
313 313
 
314 314
     /**
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
         $application->loadIfNotExistBoot(['middleware']);
334 334
         $middlewareProvider = $application['middleware'];
335 335
 
336
-        foreach($routeData as $key=>$data) {
336
+        foreach ($routeData as $key=>$data) {
337 337
 
338 338
             $middlewareProvider->setKeyOdds('endpoint', $data['endpoint']);
339 339
             $middlewareProvider->setKeyOdds('method', $data['method']);
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             $afterMiddleware = $middlewareProvider->getShow();
347 347
 
348 348
             $endpoint = $data['endpoint'];
349
-            $controllerNamespace = Utils::getNamespace($data['controller'] . '/' . $data['namespace'] . '/' . $data['class']);
349
+            $controllerNamespace = Utils::getNamespace($data['controller'].'/'.$data['namespace'].'/'.$data['class']);
350 350
 
351 351
             $methodDocument = app()['reflection']($controllerNamespace)->reflectionMethodParams($data['method'])->document;
352 352
 
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
                 }
359 359
             }
360 360
 
361
-            $mappings[$key]['endpoint'] = $endpoint . '/' . implode("/", $routePattern[$key]);
361
+            $mappings[$key]['endpoint'] = $endpoint.'/'.implode("/", $routePattern[$key]);
362 362
             $mappings[$key]['http'] = $data['http'];
363 363
             $mappings[$key]['definition'] = $methodDefinition;
364
-            $mappings[$key]['before'] = implode(",",$beforeMiddleware);
365
-            $mappings[$key]['after'] = implode(",",$afterMiddleware);
364
+            $mappings[$key]['before'] = implode(",", $beforeMiddleware);
365
+            $mappings[$key]['after'] = implode(",", $afterMiddleware);
366 366
             $mappings[$key]['doc'] = 'not available';
367 367
 
368 368
         }
Please login to merge, or discard this patch.
src/resta/Router/KernelRouterProcess.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     /**
10 10
      * @var array $routerSpecification
11 11
      */
12
-    protected $routerSpecification=[
12
+    protected $routerSpecification = [
13 13
         'pickRouter',
14 14
         'stackRouter'
15 15
     ];
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
      */
20 20
     private function pickRouter()
21 21
     {
22
-        $singleton=core();
23
-        $singleton->routerSpecifications['router']=(isset($singleton->pick)) ? $singleton->pick[0] : $singleton->routerResult;
22
+        $singleton = core();
23
+        $singleton->routerSpecifications['router'] = (isset($singleton->pick)) ? $singleton->pick[0] : $singleton->routerResult;
24 24
     }
25 25
 
26 26
     /**
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         //These are the customizations that are available in the routerSpecification object.
33 33
         //By running these individually, we assign reference values to the router variable,
34 34
         //which is the actual kernel object, so route customization takes place.
35
-        return $this->routerProcess(function($router){
35
+        return $this->routerProcess(function($router) {
36 36
             return $router;
37 37
         });
38 38
     }
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
     private function routerProcess(callable $callback)
45 45
     {
46 46
         //After running the router specification sequence one by one, we collect reference values for the kernel router.
47
-        array_walk($this->routerSpecification,[$this,'routerSpecification']);
47
+        array_walk($this->routerSpecification, [$this, 'routerSpecification']);
48 48
 
49 49
         //Then we return the routerSpecifications object that is assigned for the kernel to the router method.
50
-        return call_user_func_array($callback,[core()->routerSpecifications['router']]);
50
+        return call_user_func_array($callback, [core()->routerSpecifications['router']]);
51 51
     }
52 52
 
53 53
     /**
54 54
      * @param $specification
55 55
      * @param $key
56 56
      */
57
-    private function routerSpecification($specification,$key)
57
+    private function routerSpecification($specification, $key)
58 58
     {
59 59
         $this->{$specification}();
60 60
     }
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
         //if there is no singleton pick
72 72
         //If this is the case, we collect these values and assign them to the router variable.
73 73
         //if it is not, the router will send the default value to the output.
74
-        if(!isset($singleton->pick)){
75
-            $singleton->routerSpecifications['router']=(isset($singleton->stack)) ? $singleton->stack : $singleton->routerResult;
74
+        if (!isset($singleton->pick)) {
75
+            $singleton->routerSpecifications['router'] = (isset($singleton->stack)) ? $singleton->stack : $singleton->routerResult;
76 76
         }
77 77
     }
78 78
 
Please login to merge, or discard this patch.
src/resta/Router/RouteHttpManager.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     public static function delete(...$params) : void
16 16
     {
17 17
         // the DELETE method deletes the specified resource.
18
-        static::setRoute($params,__FUNCTION__,static::getTracePath());
18
+        static::setRoute($params, __FUNCTION__, static::getTracePath());
19 19
     }
20 20
 
21 21
     /**
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         // the GET method requests a representation of the specified resource.
30 30
         // Requests using GET should only retrieve data.
31
-        static::setRoute($params,__FUNCTION__,static::getTracePath());
31
+        static::setRoute($params, __FUNCTION__, static::getTracePath());
32 32
     }
33 33
 
34 34
     /**
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         // the POST method is used to submit an entity to the specified resource,
60 60
         // often causing a change in state or side effects on the server.
61
-        static::setRoute($params,__FUNCTION__,static::getTracePath());
61
+        static::setRoute($params, __FUNCTION__, static::getTracePath());
62 62
     }
63 63
 
64 64
     /**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     {
72 72
         // the PUT method replaces all current representations of
73 73
         // the target resource with the request payload.
74
-        static::setRoute($params,__FUNCTION__,static::getTracePath());
74
+        static::setRoute($params, __FUNCTION__, static::getTracePath());
75 75
     }
76 76
 
77 77
     /**
Please login to merge, or discard this patch.
src/resta/Authenticate/AuthenticateContract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      * @param bool $objectReturn
26 26
      * @return mixed
27 27
      */
28
-    public function login($credentials=array(),$objectReturn=false);
28
+    public function login($credentials = array(), $objectReturn = false);
29 29
 
30 30
     /**
31 31
      * @return mixed
Please login to merge, or discard this patch.
src/resta/Authenticate/Resource/AuthLogoutManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
      * @param $auth
15 15
      * @param $token
16 16
      */
17
-    public function __construct($auth,$token)
17
+    public function __construct($auth, $token)
18 18
     {
19 19
         parent::__construct($auth);
20 20
 
21 21
         //token value received by client
22
-        $this->token=$token;
22
+        $this->token = $token;
23 23
 
24 24
         //query check
25 25
         $this->logoutProcess();
Please login to merge, or discard this patch.
src/resta/Authenticate/AuthenticateProvider.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,9 @@
 block discarded – undo
77 77
 
78 78
         // if you want to see the entire login manager object directly,
79 79
         // send true to the objectReturn parameter.
80
-        if($objectReturn) return $loginManager;
80
+        if($objectReturn) {
81
+            return $loginManager;
82
+        }
81 83
 
82 84
         // the login value stored in the params property of the login manager object will return a builder object.
83 85
         // we will return the value of the login state as a boolean using the count method of this builder object.
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 class AuthenticateProvider extends ConfigProvider implements AuthenticateContract
11 11
 {
12 12
     //get auth response,auth exception,auth token and auth basic
13
-    use AuthenticateResponse,AuthenticateException,AuthenticateToken,AuthenticateBasic;
13
+    use AuthenticateResponse, AuthenticateException, AuthenticateToken, AuthenticateBasic;
14 14
 
15 15
     /**
16 16
      * @var string
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
     {
27 27
         // we obtain the data value obtained via
28 28
         // authenticate availability with the help of callback object.
29
-        return $this->checkParamsViaAvailability(function(){
30
-            return (new AuthUserManager($this->currentDeviceToken(),$this))->allDeviceTokens();
29
+        return $this->checkParamsViaAvailability(function() {
30
+            return (new AuthUserManager($this->currentDeviceToken(), $this))->allDeviceTokens();
31 31
         });
32 32
     }
33 33
 
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
     {
41 41
         // header to determine whether
42 42
         // the token value is present and return a callback.
43
-        return $this->checkTokenViaHeaders(function($token){
43
+        return $this->checkTokenViaHeaders(function($token) {
44 44
 
45 45
             // we send the user-supplied token value
46 46
             // to the authCheckManager object.
47
-            new AuthCheckManager($this,$token);
47
+            new AuthCheckManager($this, $token);
48 48
 
49 49
             // as a result we send output according to
50 50
             // the boolean value from the checkResult method.
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         // we obtain the data value obtained via
63 63
         // authenticate availability with the help of callback object.
64
-        return $this->checkParamsViaAvailability('data',function($data){
64
+        return $this->checkParamsViaAvailability('data', function($data) {
65 65
             return $data;
66 66
         });
67 67
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      * @param bool $objectReturn
90 90
      * @return $this|mixed
91 91
      */
92
-    public function login($credentials=null,$objectReturn=false)
92
+    public function login($credentials = null, $objectReturn = false)
93 93
     {
94 94
         // we will determine whether
95 95
         // the http path is correct for this method.
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 
98 98
         // we invoke the login manager and the properties
99 99
         // that this class creates will inform us about user input.
100
-        $loginManager = new AuthLoginManager($credentials,$this);
100
+        $loginManager = new AuthLoginManager($credentials, $this);
101 101
 
102 102
         // if you want to see the entire login manager object directly,
103 103
         // send true to the objectReturn parameter.
104
-        if($objectReturn) return $loginManager;
104
+        if ($objectReturn) return $loginManager;
105 105
 
106 106
         // the login value stored in the params property of the login manager object will return a builder object.
107 107
         // we will return the value of the login state as a boolean using the count method of this builder object.
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 
123 123
         // header to determine whether
124 124
         // the token value is present and return a callback.
125
-        return $this->checkTokenViaHeaders(function($token){
125
+        return $this->checkTokenViaHeaders(function($token) {
126 126
 
127 127
             // we send the user-supplied token value
128 128
             // to the authCheckManager object.
129
-            new AuthLogoutManager($this,$token);
129
+            new AuthLogoutManager($this, $token);
130 130
 
131 131
             // as a result we send output according to
132 132
             // the boolean value from the checkResult method.
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
     {
144 144
         // we obtain the user value obtained via
145 145
         // authenticate availability with the help of callback object.
146
-        return $this->checkParamsViaAvailability(function(){
147
-            return (new AuthUserManager($this->currentDeviceToken(),$this))->userProcess();
146
+        return $this->checkParamsViaAvailability(function() {
147
+            return (new AuthUserManager($this->currentDeviceToken(), $this))->userProcess();
148 148
         });
149 149
     }
150 150
 
Please login to merge, or discard this patch.
src/resta/Cache/CacheConfigDetector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@
 block discarded – undo
18 18
      */
19 19
     public function __construct()
20 20
     {
21
-        if(config('cache.default')!==null){
21
+        if (config('cache.default')!==null) {
22 22
 
23 23
             $default = config('cache.default');
24 24
 
25 25
             $this->config['adapter']  = config('cache.stores.'.$default.'.driver') ?? exception()->invalidArgument('driver for '.$default.' within cache config is not valid');
26
-            $this->config['path']     = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache' ;
26
+            $this->config['path']     = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache';
27 27
             $this->config['expire']   = config('cache.stores.'.$default.'.expire') ?? 0;
28 28
         }
29 29
     }
Please login to merge, or discard this patch.
src/resta/Environment/CheckEnvironmentFile.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     {
15 15
         //if the env file does not exist, we automatically detect
16 16
         //that the environment variable is in the production environment.
17
-        if(!file_exists($this->getEnvironmentPath())){
17
+        if (!file_exists($this->getEnvironmentPath())) {
18 18
             return [];
19 19
         }
20 20
 
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
      * @param bool $status
30 30
      * @return mixed
31 31
      */
32
-    public function getEnvironment($status=false)
32
+    public function getEnvironment($status = false)
33 33
     {
34 34
         //If the status value is false then direct path is invoked. If true is sent, variables are sent.
35
-        return (false === $status) ? $this->getEnvironmentPath() : $this->getEnvironmentVariables();
35
+        return (false===$status) ? $this->getEnvironmentPath() : $this->getEnvironmentVariables();
36 36
     }
37 37
 
38 38
     /**
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
     private function identifierEnvironment()
60 60
     {
61 61
         //We parse our environment variables through the yaml file.
62
-        $environment=$this->getEnvironment(true);
62
+        $environment = $this->getEnvironment(true);
63 63
 
64 64
         //the application will automatically throw an exception
65 65
         //if there is no env key in the parse variables.
66
-        if(!isset($environment['env'])){
66
+        if (!isset($environment['env'])) {
67 67
             exception()->invalidArgument('The env key missing on your environment');
68 68
         }
69 69
 
Please login to merge, or discard this patch.
src/resta/Environment/EnvironmentProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
      * @param null $environment
15 15
      * @return string
16 16
      */
17
-    public function environment($var=array(),$environment=null)
17
+    public function environment($var = array(), $environment = null)
18 18
     {
19 19
         //environment is recognized as a production environment directly
20 20
         //if there is no env object in the environment variable.
21 21
         $isProduction = $environment['env'] ?? 'production';
22 22
 
23 23
         //we issue a controlled environment key map for the submitted environment
24
-        return (count($var)===0) ? $isProduction : self::getEnvironmentForVariables($var,$environment);
24
+        return (count($var)===0) ? $isProduction : self::getEnvironmentForVariables($var, $environment);
25 25
     }
26 26
 
27 27
     /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      * @param null $environment
32 32
      * @return mixed
33 33
      */
34
-    private static function getEnvironmentForVariables($var=array(),$environment=null)
34
+    private static function getEnvironmentForVariables($var = array(), $environment = null)
35 35
     {
36 36
         //environment variable specified by the variable is checked in the defined file
37 37
         //and the value is returned accordingly.
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     public function handle()
47 47
     {
48 48
         //set define for config
49
-        define ('environment',true);
49
+        define('environment', true);
50 50
 
51 51
         //where we do the checks for the environment file type,
52 52
         //and if no configuration file is found, the system throws an exception.
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
      * @param null $configuration
63 63
      * @return void
64 64
      */
65
-    private function set($configuration=null)
65
+    private function set($configuration = null)
66 66
     {
67 67
         //we are doing global registration for env and var value.
68
-        $this->app->register('environmentVariables',$configuration);
69
-        $this->app->register('env',$this->environment([],$this->app['environmentVariables']));
68
+        $this->app->register('environmentVariables', $configuration);
69
+        $this->app->register('env', $this->environment([], $this->app['environmentVariables']));
70 70
     }
71 71
 }
72 72
\ No newline at end of file
Please login to merge, or discard this patch.