Passed
Push — master ( f5f23d...37cc8e )
by Php Easy Api
03:02
created
src/resta/Middleware/MiddlewareProvider.php 2 patches
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -141,7 +141,9 @@  discard block
 block discarded – undo
141 141
 
142 142
         //method can only return fixed.
143 143
         if(!is_null($key)){
144
-            if(isset($$key)) return $$key;
144
+            if(isset($$key)) {
145
+                return $$key;
146
+            }
145 147
         }
146 148
 
147 149
         //middleware key odds
@@ -170,8 +172,7 @@  discard block
 block discarded – undo
170 172
             // it is detected as a short name and is searched in the middleware directory.
171 173
             if(Utils::isNamespaceExists($middleVal)){
172 174
                 $middlewareNamespace = $middleVal;
173
-            }
174
-            else{
175
+            } else{
175 176
                 $middlewareNamespace = app()->namespace()->middleware().'\\'.ucfirst($middleVal);
176 177
             }
177 178
 
@@ -271,7 +272,9 @@  discard block
 block discarded – undo
271 272
     {
272 273
         //If the all option is present,
273 274
         //it is automatically injected into all services for the middleware application.
274
-        if($key==="all") return true;
275
+        if($key==="all") {
276
+            return true;
277
+        }
275 278
 
276 279
         //service middleware key
277 280
         //if it is array,check odds
@@ -311,8 +314,7 @@  discard block
 block discarded – undo
311 314
                 $middlewareList = array_merge($middlewareList,[$middleValue]);
312 315
                 $this->app->register('pointer','middlewareList',$middlewareList);
313 316
             }
314
-        }
315
-        else{
317
+        } else{
316 318
             $this->app->register('pointer','middlewareList',[$middleValue]);
317 319
         }
318 320
     }
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function getResolveServiceMiddleware()
61 61
     {
62
-        if(!is_null($this->serviceMiddleware)){
62
+        if (!is_null($this->serviceMiddleware)) {
63 63
             return $this->app->resolve($this->serviceMiddleware);
64 64
         }
65 65
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     public function handle()
95 95
     {
96 96
         //set define for middleware
97
-        define('middleware',true);
97
+        define('middleware', true);
98 98
 
99 99
         //middleware handle process
100 100
         $this->handleMiddlewareProcess();
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      * @param string $method
107 107
      * @return void|mixed
108 108
      */
109
-    public function handleMiddlewareProcess($method='handle')
109
+    public function handleMiddlewareProcess($method = 'handle')
110 110
     {
111 111
         // the app instance is a global application example,
112 112
         // and a hash is loaded as this hash.
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         // the middleware class must be subject to
116 116
         // the ServiceMiddlewareManagerContracts interface rule to be implemented.
117
-        if(!$this->getResolveServiceMiddleware() instanceof ServiceMiddlewareManagerContracts){
117
+        if (!$this->getResolveServiceMiddleware() instanceof ServiceMiddlewareManagerContracts) {
118 118
             exception()->badMethodCall('Service middleware does not have ServiceMiddlewareManagerContracts');
119 119
         }
120 120
 
@@ -131,17 +131,17 @@  discard block
 block discarded – undo
131 131
      * @param $key null
132 132
      * @return array
133 133
      */
134
-    public function middlewareKeyOdds($key=null)
134
+    public function middlewareKeyOdds($key = null)
135 135
     {
136 136
         // identifying constants for the middleware layer.
137 137
         // with the property of the user, the user is free to determine the constants that the middleware layer wants.
138
-        $method     = $this->odds['method'] ?? implode("/",$this->app['routeParameters']);
138
+        $method     = $this->odds['method'] ?? implode("/", $this->app['routeParameters']);
139 139
         $endpoint   = $this->odds['endpoint'] ?? endpoint;
140 140
         $http       = $this->odds['http'] ?? $this->app['httpMethod'];
141 141
 
142 142
         //method can only return fixed.
143
-        if(!is_null($key)){
144
-            if(isset($$key)) return $$key;
143
+        if (!is_null($key)) {
144
+            if (isset($$key)) return $$key;
145 145
         }
146 146
 
147 147
         //middleware key odds
@@ -157,21 +157,21 @@  discard block
 block discarded – undo
157 157
      *
158 158
      * @param array $middleware
159 159
      */
160
-    public function serviceMiddleware($middleware=array())
160
+    public function serviceMiddleware($middleware = array())
161 161
     {
162 162
         $this->show = [];
163 163
 
164 164
         //It will be run individually according to the rules of
165 165
         //the middleware classes specified for the service middleware middleware.
166
-        foreach($middleware as $middleVal=>$middleKey){
166
+        foreach ($middleware as $middleVal=>$middleKey) {
167 167
 
168 168
             // if the keys in the array in the service middleware class represent a class,
169 169
             // this value is checked, if it does not represent the class,
170 170
             // it is detected as a short name and is searched in the middleware directory.
171
-            if(Utils::isNamespaceExists($middleVal)){
171
+            if (Utils::isNamespaceExists($middleVal)) {
172 172
                 $middlewareNamespace = $middleVal;
173 173
             }
174
-            else{
174
+            else {
175 175
                 $middlewareNamespace = app()->namespace()->middleware().'\\'.ucfirst($middleVal);
176 176
             }
177 177
 
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
             //it will be handled according to the following rule.
191 191
             //The exclude class will return a callback and allocate the result as bool to the exclude variable.
192 192
             //If the exclude variable is true then the middleware will be run.
193
-            $excludeClass->exclude($this->middleware,function($exclude) use ($middleVal){
193
+            $excludeClass->exclude($this->middleware, function($exclude) use ($middleVal){
194 194
 
195
-                if($exclude){
195
+                if ($exclude) {
196 196
 
197 197
                     //the condition of a specific statement to be handled
198
-                    if($this->checkNamespaceAndSpecificCondition()){
198
+                    if ($this->checkNamespaceAndSpecificCondition()) {
199 199
                         $this->pointer($middleVal);
200 200
 
201 201
                         //directly registered to the middleware name show property.
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 
204 204
                         // the middleware namespace must have handletraitcontract interface property.
205 205
                         // otherwise, middleware will not work.
206
-                        if(false === $this->app->runningInConsole()
207
-                            && $this->app->resolve($this->middleware['namespace']) instanceof HandleContracts){
206
+                        if (false===$this->app->runningInConsole()
207
+                            && $this->app->resolve($this->middleware['namespace']) instanceof HandleContracts) {
208 208
                             $this->app->resolve($this->middleware['namespace'])->handle();
209 209
                         }
210 210
                     }
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
      * @param null $key
221 221
      * @param null $value
222 222
      */
223
-    public function setKeyOdds($key=null,$value=null)
223
+    public function setKeyOdds($key = null, $value = null)
224 224
     {
225 225
         //user-defined middleware constants.
226
-        if(!is_null($key) && !is_null($value)){
226
+        if (!is_null($key) && !is_null($value)) {
227 227
             $this->odds[$key] = $value;
228 228
         }
229 229
     }
@@ -240,13 +240,13 @@  discard block
 block discarded – undo
240 240
 
241 241
         // if the service middleware does not represent a class,
242 242
         // then in this case core support is assigned as a class service middleware.
243
-        if(Utils::isNamespaceExists($serviceMiddleware)===false){
243
+        if (Utils::isNamespaceExists($serviceMiddleware)===false) {
244 244
             $serviceMiddleware = ServiceMiddlewareManager::class;
245 245
         }
246 246
 
247 247
         //We are logging the kernel for the middleware class and the exclude class
248
-        $this->app->register('middlewareClass',$this->app->resolve($serviceMiddleware));
249
-        $this->app->register('excludeClass',$this->app->resolve(ExcludeMiddleware::class));
248
+        $this->app->register('middlewareClass', $this->app->resolve($serviceMiddleware));
249
+        $this->app->register('excludeClass', $this->app->resolve(ExcludeMiddleware::class));
250 250
     }
251 251
 
252 252
     /**
@@ -254,9 +254,9 @@  discard block
 block discarded – undo
254 254
      *
255 255
      * @param null $serviceMiddleware
256 256
      */
257
-    public function setserviceMiddleware($serviceMiddleware=null)
257
+    public function setserviceMiddleware($serviceMiddleware = null)
258 258
     {
259
-        if(!is_null($serviceMiddleware)){
259
+        if (!is_null($serviceMiddleware)) {
260 260
             $this->serviceMiddleware = $serviceMiddleware;
261 261
         }
262 262
     }
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
     {
272 272
         //If the all option is present,
273 273
         //it is automatically injected into all services for the middleware application.
274
-        if($key==="all") return true;
274
+        if ($key==="all") return true;
275 275
 
276 276
         //service middleware key
277 277
         //if it is array,check odds
278
-        if(is_array($key)){
278
+        if (is_array($key)) {
279 279
 
280 280
             //get middleware odd keys
281 281
             $odds = $this->middlewareKeyOdds();
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
             //then the middleware is conditioned and the services are individually checked according to
285 285
             //the degree of conformity with the middlewareOdds method and
286 286
             //the middleware is executed under the specified condition.
287
-            foreach($key as $item){
288
-                if(in_array($item,$odds)){
287
+            foreach ($key as $item) {
288
+                if (in_array($item, $odds)) {
289 289
                     return true;
290 290
                 }
291 291
             }
@@ -303,17 +303,17 @@  discard block
 block discarded – undo
303 303
      */
304 304
     private function pointer($middleValue)
305 305
     {
306
-        if(isset($this->app['pointer']['middlewareList'])){
306
+        if (isset($this->app['pointer']['middlewareList'])) {
307 307
 
308 308
             $middlewareList = $this->app['pointer']['middlewareList'];
309 309
 
310
-            if(is_array($middlewareList)){
311
-                $middlewareList = array_merge($middlewareList,[$middleValue]);
312
-                $this->app->register('pointer','middlewareList',$middlewareList);
310
+            if (is_array($middlewareList)) {
311
+                $middlewareList = array_merge($middlewareList, [$middleValue]);
312
+                $this->app->register('pointer', 'middlewareList', $middlewareList);
313 313
             }
314 314
         }
315
-        else{
316
-            $this->app->register('pointer','middlewareList',[$middleValue]);
315
+        else {
316
+            $this->app->register('pointer', 'middlewareList', [$middleValue]);
317 317
         }
318 318
     }
319 319
 }
320 320
\ No newline at end of file
Please login to merge, or discard this patch.
src/resta/Router/RouteProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
     private function getCallBindController()
40 40
     {
41 41
         //we finally process the method of the class invoked by the user as a process and prepare it for the response
42
-        return app()->resolve(RouteWatch::class)->watch(function(){
42
+        return app()->resolve(RouteWatch::class)->watch(function() {
43 43
             
44 44
             // if the method in the instance object exists,
45 45
             // this method is executed to produce the output.
46
-            if(method_exists($this->app['instanceController'],$this->app['method'])){
47
-                return DIContainerManager::callBind([$this->app['instanceController'],$this->app['method']],
46
+            if (method_exists($this->app['instanceController'], $this->app['method'])) {
47
+                return DIContainerManager::callBind([$this->app['instanceController'], $this->app['method']],
48 48
                     $this->app->applicationProviderBinding($this->app));
49 49
             }
50 50
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function handle()
65 65
     {
66
-        $this->app->register('routerResult',$this->callController());
66
+        $this->app->register('routerResult', $this->callController());
67 67
 
68 68
         //we call our services as controller
69 69
         return $this->app['routerResult'];
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
         $namespace = $this->getControllerNamespace();
81 81
 
82 82
         //utils make bind via dependency injection named as service container
83
-        $this->app->register('serviceConf',$this->app['fileSystem']->callFile(StaticPathModel::getServiceConf()));
84
-        $this->app->register('instanceController',$this->app->resolve($namespace));
83
+        $this->app->register('serviceConf', $this->app['fileSystem']->callFile(StaticPathModel::getServiceConf()));
84
+        $this->app->register('instanceController', $this->app->resolve($namespace));
85 85
     }
86 86
 
87 87
     /**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
         // based on the serviceConf variable,
100 100
         // we are doing parameter bindings in the method context in the routeParameters array key.
101
-        $this->app->register('serviceConf','routeParameters',[$method=>$parameters]);
101
+        $this->app->register('serviceConf', 'routeParameters', [$method=>$parameters]);
102 102
 
103 103
     }
104 104
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function setMethodNameViaDefine($methodName)
112 112
     {
113
-        define('methodName',strtolower($methodName));
113
+        define('methodName', strtolower($methodName));
114 114
     }
115 115
 
116 116
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $fromRoutes = Route::getRouteResolve();
142 142
         $method = $fromRoutes['method'] ?? $method;
143 143
 
144
-        $this->app->register('method',$method);
144
+        $this->app->register('method', $method);
145 145
         $this->app->register('routeParameters', $this->routeParametersAssign($this->resolveMethod($method)));
146 146
 
147 147
     }
Please login to merge, or discard this patch.
src/resta/Router/CheckEndpointForAutoService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
      * @param callable|null $func
12 12
      * @return string
13 13
      */
14
-    public function getNamespaceForAutoService($instance,callable $func = null)
14
+    public function getNamespaceForAutoService($instance, callable $func = null)
15 15
     {
16 16
         //get namespace for auto service
17 17
         $autoServiceNamespace = $instance->autoService();
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $configAutoServices = config('autoservices');
22 22
 
23 23
         //auto service is invoked if auto service is allowed for any class yada config.
24
-        if(class_exists($autoServiceNamespace) && $configAutoServices[strtolower(endpoint)]){
24
+        if (class_exists($autoServiceNamespace) && $configAutoServices[strtolower(endpoint)]) {
25 25
             return $autoServiceNamespace;
26 26
         }
27 27
 
Please login to merge, or discard this patch.
src/resta/Router/RouteAccessiblePropertyTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     {
53 53
         // detects where the route path is coming from
54 54
         // and returns this data in the static path.
55
-        $trace = Utils::trace(2,'file');
55
+        $trace = Utils::trace(2, 'file');
56 56
 
57 57
         // the trace is returned if the variable is available
58 58
         // in the path data, otherwise it returns null.
Please login to merge, or discard this patch.
src/resta/Router/RouteWatch.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,17 +12,17 @@
 block discarded – undo
12 12
      */
13 13
     public function watch(callable $callback)
14 14
     {
15
-        if(config('app.watch')){
15
+        if (config('app.watch')) {
16 16
 
17 17
             // the memory usage component provides
18 18
             // a way to profile code.
19 19
             $memoryUsage = memory_get_usage();
20 20
 
21 21
             //get controller output
22
-            $controllerOutput=call_user_func($callback);
22
+            $controllerOutput = call_user_func($callback);
23 23
 
24 24
             //save to kernel for a variable named controller Watch
25
-            $this->app->register('controllerWatch', 'memory',memory_get_usage() - $memoryUsage);
25
+            $this->app->register('controllerWatch', 'memory', memory_get_usage()-$memoryUsage);
26 26
         }
27 27
 
28 28
         // if watch config is true; in this case
Please login to merge, or discard this patch.
src/resta/Router/Route.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -173,9 +173,9 @@
 block discarded – undo
173 173
 
174 174
         // in the paths data,
175 175
         // we run the route mapper values ​​and the route files one by one.
176
-       foreach (self::$paths as $mapper=>$controller){
177
-           core()->fileSystem->callFile($mapper);
178
-       }
176
+        foreach (self::$paths as $mapper=>$controller){
177
+            core()->fileSystem->callFile($mapper);
178
+        }
179 179
     }
180 180
 
181 181
     /**
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 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
-    private static function checkArrayEqual($patterns,$urlRoute)
46
+    private 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
         }
@@ -68,51 +68,51 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $routes = self::getRoutes();
70 70
 
71
-        if(!isset($routes['pattern'])){
71
+        if (!isset($routes['pattern'])) {
72 72
             return [];
73 73
         }
74 74
 
75 75
         $patterns = $routes['pattern'];
76
-        $urlRoute = array_filter(route(),'strlen');
76
+        $urlRoute = array_filter(route(), 'strlen');
77 77
 
78 78
         $patternList = [];
79 79
 
80
-        foreach($routes['data'] as $patternKey=>$routeData){
81
-            if($routeData['http']==httpMethod()){
82
-                $patternList[$patternKey]=$patterns[$patternKey];
80
+        foreach ($routes['data'] as $patternKey=>$routeData) {
81
+            if ($routeData['http']==httpMethod()) {
82
+                $patternList[$patternKey] = $patterns[$patternKey];
83 83
             }
84 84
         }
85 85
 
86
-        foreach ($patternList as $key=>$pattern){
86
+        foreach ($patternList as $key=>$pattern) {
87 87
 
88
-            $pattern = array_filter($pattern,'strlen');
89
-            $diff = Arr::arrayDiffKey($pattern,$urlRoute);
88
+            $pattern = array_filter($pattern, 'strlen');
89
+            $diff = Arr::arrayDiffKey($pattern, $urlRoute);
90 90
 
91
-            if($diff){
91
+            if ($diff) {
92 92
 
93 93
                 $matches = true;
94 94
 
95
-                foreach ($pattern as $patternKey=>$patternValue){
96
-                    if(!preg_match('@\{(.*?)\}@is',$patternValue)){
97
-                        if($patternValue!==$urlRoute[$patternKey]){
95
+                foreach ($pattern as $patternKey=>$patternValue) {
96
+                    if (!preg_match('@\{(.*?)\}@is', $patternValue)) {
97
+                        if ($patternValue!==$urlRoute[$patternKey]) {
98 98
                             $matches = false;
99 99
                         }
100 100
                     }
101 101
                 }
102 102
 
103
-                if($matches){
103
+                if ($matches) {
104 104
 
105
-                    $isArrayEqual = self::checkArrayEqual($patternList,$urlRoute);
105
+                    $isArrayEqual = self::checkArrayEqual($patternList, $urlRoute);
106 106
 
107
-                    if($isArrayEqual===null){
107
+                    if ($isArrayEqual===null) {
108 108
                         return $key;
109 109
                     }
110 110
                     return $isArrayEqual;
111 111
                 }
112 112
             }
113 113
 
114
-            if(count($pattern)-1 == count(route())){
115
-                if(preg_match('@\{[a-z]+\?\}@is',end($pattern))){
114
+            if (count($pattern)-1==count(route())) {
115
+                if (preg_match('@\{[a-z]+\?\}@is', end($pattern))) {
116 116
                     return $key;
117 117
                 }
118 118
             }
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
         $patternResolve = self::getPatternResolve();
133 133
 
134 134
         //if routes data is available in pattern resolve.
135
-        if(isset($routes['data'][$patternResolve])){
135
+        if (isset($routes['data'][$patternResolve])) {
136 136
 
137 137
             // if the incoming http value is
138 138
             // the same as the real request method, the data is processed.
139
-            if($routes['data'][$patternResolve]['http'] == strtolower(httpMethod)){
139
+            if ($routes['data'][$patternResolve]['http']==strtolower(httpMethod)) {
140 140
 
141 141
                 // we are set the solved pattern to a variable.
142 142
                 $resolve = $routes['data'][$patternResolve];
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     {
162 162
         // we will record the path data for the route.
163 163
         // We set the routeMapper variables and the route path.
164
-        self::setPath(function(){
164
+        self::setPath(function() {
165 165
 
166 166
             // we are sending
167 167
             // the controller and routes.php path.
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
         // in the paths data,
175 175
         // we run the route mapper values ​​and the route files one by one.
176
-       foreach (self::$paths as $mapper=>$controller){
176
+       foreach (self::$paths as $mapper=>$controller) {
177 177
            core()->fileSystem->callFile($mapper);
178 178
        }
179 179
     }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     {
188 188
         $routeDefinitor = call_user_func($callback);
189 189
 
190
-        if(isset($routeDefinitor['controllerPath']) && isset($routeDefinitor['routePath'])){
190
+        if (isset($routeDefinitor['controllerPath']) && isset($routeDefinitor['routePath'])) {
191 191
 
192 192
             //the route paths to be saved to the mappers static property.
193 193
             static::$mappers['routePaths'][] = $routeDefinitor['routePath'];
@@ -195,22 +195,22 @@  discard block
 block discarded – undo
195 195
 
196 196
             // if there is endpoint,
197 197
             // then only that endpoint is transferred into the path
198
-            if(defined('endpoint')){
198
+            if (defined('endpoint')) {
199 199
 
200 200
                 $routeName      = endpoint.'Route.php';
201 201
                 $routeMapper    = $routeDefinitor['routePath'].''.DIRECTORY_SEPARATOR.''.$routeName;
202 202
 
203
-                if(file_exists($routeMapper) && !isset(static::$paths[$routeMapper])){
203
+                if (file_exists($routeMapper) && !isset(static::$paths[$routeMapper])) {
204 204
                     static::$paths[$routeMapper] = $routeDefinitor['controllerPath'];
205 205
                 }
206 206
             }
207
-            else{
207
+            else {
208 208
 
209 209
                 // if there is no endpoint,
210 210
                 // all files in the path of the route are transferred to path.
211 211
                 $allFilesInThatRoutePath = Utils::glob($routeDefinitor['routePath']);
212 212
 
213
-                foreach ($allFilesInThatRoutePath as $item){
213
+                foreach ($allFilesInThatRoutePath as $item) {
214 214
                     static::$paths[$item] = $routeDefinitor['controllerPath'];
215 215
                 }
216 216
             }
@@ -224,13 +224,13 @@  discard block
 block discarded – undo
224 224
      * @param $function
225 225
      * @param null $controller
226 226
      */
227
-    public static function setRoute($params,$function,$controller=null)
227
+    public static function setRoute($params, $function, $controller = null)
228 228
     {
229
-        [$pattern,$route]   = $params;
230
-        [$class,$method]    = explode("@",$route);
229
+        [$pattern, $route]   = $params;
230
+        [$class, $method]    = explode("@", $route);
231 231
 
232 232
         $patternList = array_values(
233
-            array_filter(explode("/",$pattern),'strlen')
233
+            array_filter(explode("/", $pattern), 'strlen')
234 234
         );
235 235
 
236 236
         static::$routes['pattern'][] = $patternList;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             'http'          => $function,
241 241
             'controller'    => $controller,
242 242
             'namespace'     => static::$namespace,
243
-            'endpoint'      => strtolower(str_replace(StaticPathList::$controllerBundleName,'',static::$namespace))
243
+            'endpoint'      => strtolower(str_replace(StaticPathList::$controllerBundleName, '', static::$namespace))
244 244
         ];
245 245
     }
246 246
 }
247 247
\ No newline at end of file
Please login to merge, or discard this patch.
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.
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.