Passed
Branch master (8c1158)
by Php Easy Api
06:05 queued 03:03
created
src/resta/Logger/LoggerHandler.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
51 51
      */
52 52
     public function alert($message, array $context = [])
53 53
     {
54
-        return $this->writeLog(__FUNCTION__,$message,$context);
54
+        return $this->writeLog(__FUNCTION__, $message, $context);
55 55
     }
56 56
 
57 57
     /**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     public function critical($message, array $context = [])
65 65
     {
66
-        return $this->writeLog(__FUNCTION__,$message,$context);
66
+        return $this->writeLog(__FUNCTION__, $message, $context);
67 67
     }
68 68
 
69 69
     /**
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     public function debug($message, array $context = [])
77 77
     {
78
-        return $this->writeLog(__FUNCTION__,$message,$context);
78
+        return $this->writeLog(__FUNCTION__, $message, $context);
79 79
     }
80 80
 
81 81
     /**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function emergency($message, array $context = [])
89 89
     {
90
-        return $this->writeLog(__FUNCTION__,$message,$context);
90
+        return $this->writeLog(__FUNCTION__, $message, $context);
91 91
     }
92 92
 
93 93
     /**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function error($message, array $context = [])
101 101
     {
102
-        return $this->writeLog(__FUNCTION__,$message,$context);
102
+        return $this->writeLog(__FUNCTION__, $message, $context);
103 103
     }
104 104
 
105 105
     /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function info($message, array $context = [])
113 113
     {
114
-        return $this->writeLog(__FUNCTION__,$message,$context);
114
+        return $this->writeLog(__FUNCTION__, $message, $context);
115 115
     }
116 116
 
117 117
     /**
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function notice($message, array $context = [])
137 137
     {
138
-        return $this->writeLog(__FUNCTION__,$message,$context);
138
+        return $this->writeLog(__FUNCTION__, $message, $context);
139 139
     }
140 140
 
141 141
     /**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      */
148 148
     public function warning($message, array $context = [])
149 149
     {
150
-        return $this->writeLog(__FUNCTION__,$message,$context);
150
+        return $this->writeLog(__FUNCTION__, $message, $context);
151 151
     }
152 152
 
153 153
     /**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     {
162 162
         $file = ($this->file===null) ? $level : $this->file;
163 163
 
164
-        if($this->adapter!==null){
164
+        if ($this->adapter!==null) {
165 165
 
166 166
             $adapter = $this->adapter;
167 167
 
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
             });
171 171
         }
172 172
 
173
-        if($this->logger!==null){
174
-            $this->logger->logHandler($message,$file,$level);
173
+        if ($this->logger!==null) {
174
+            $this->logger->logHandler($message, $file, $level);
175 175
         }
176 176
 
177 177
     }
Please login to merge, or discard this patch.
src/resta/Foundation/ApplicationHelpers.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     function applicationKey()
50 50
     {
51
-        if(property_exists($kernel=app()->kernel(),'applicationKey')){
51
+        if (property_exists($kernel = app()->kernel(), 'applicationKey')) {
52 52
             return $kernel->applicationKey;
53 53
         }
54 54
         return null;
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     function bundleName()
83 83
     {
84
-        if(defined('endpoint')){
84
+        if (defined('endpoint')) {
85 85
 
86 86
             return endpoint.''.StaticPathList::$controllerBundleName;
87 87
         }
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
      * @param null $default
97 97
      * @return mixed|null
98 98
      */
99
-    function config($config=null,$default=null)
99
+    function config($config = null, $default = null)
100 100
     {
101 101
         $configResult = app()->config($config);
102 102
 
103
-        if($configResult === null && $default!==null){
103
+        if ($configResult===null && $default!==null) {
104 104
             return $default;
105 105
         }
106 106
 
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
      * @param $bind array
116 116
      * @return mixed
117 117
      */
118
-    function container($class,$bind=array())
118
+    function container($class, $bind = array())
119 119
     {
120
-        return app()->singleton()->appClass->container(appInstance(),$class,$bind);
120
+        return app()->singleton()->appClass->container(appInstance(), $class, $bind);
121 121
     }
122 122
 }
123 123
 
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
      * @param array $params
167 167
      * @return ExceptionContracts
168 168
      */
169
-    function exception($name=null,$params=array())
169
+    function exception($name = null, $params = array())
170 170
     {
171
-        $exceptionManager=ExceptionManager::class;
172
-        return app()->resolve($exceptionManager,['name'=>$name,'params'=>$params]);
171
+        $exceptionManager = ExceptionManager::class;
172
+        return app()->resolve($exceptionManager, ['name'=>$name, 'params'=>$params]);
173 173
     }
174 174
 }
175 175
 
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
      * @param null $locale
180 180
      * @return Generator
181 181
      */
182
-    function faker($locale=null)
182
+    function faker($locale = null)
183 183
     {
184
-        if($locale===null){
185
-            $faker=Factory::create();
184
+        if ($locale===null) {
185
+            $faker = Factory::create();
186 186
         }
187
-        else{
188
-            $faker=Factory::create($locale);
187
+        else {
188
+            $faker = Factory::create($locale);
189 189
         }
190 190
 
191 191
         return $faker;
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 
197 197
     function fingerPrint()
198 198
     {
199
-        return md5(sha1(implode("|",[
200
-            request()->getClientIp(),$_SERVER['HTTP_USER_AGENT'],applicationKey()
199
+        return md5(sha1(implode("|", [
200
+            request()->getClientIp(), $_SERVER['HTTP_USER_AGENT'], applicationKey()
201 201
         ])));
202 202
     }
203 203
 }
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
      * @param null $default
218 218
      * @return null
219 219
      */
220
-    function get($param=null,$default=null)
220
+    function get($param = null, $default = null)
221 221
     {
222 222
         //symfony request query object
223
-        $get=core()->get;
223
+        $get = core()->get;
224 224
 
225 225
         return ($param===null) ? $get : (isset($get[$param]) ? $get[$param] : $default);
226 226
     }
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
      * @param null $default
234 234
      * @return array
235 235
      */
236
-    function headers($param=null,$default=null)
236
+    function headers($param = null, $default = null)
237 237
     {
238
-        $list=[];
238
+        $list = [];
239 239
 
240 240
         //We only get the objects in the list name to match the header objects
241 241
         //that come with the request path to the objects sent by the client
242 242
         foreach (request()->headers->all() as $key=>$value) {
243
-            $list[$key]=$value;
243
+            $list[$key] = $value;
244 244
         }
245 245
 
246 246
         //return header list
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
      * @param $file null
266 266
      * @return LoggerHandler
267 267
      */
268
-    function logger($file=null)
268
+    function logger($file = null)
269 269
     {
270
-        return app()->resolve(LoggerHandler::class,['file'=>$file]);
270
+        return app()->resolve(LoggerHandler::class, ['file'=>$file]);
271 271
     }
272 272
 }
273 273
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
      */
290 290
     function response()
291 291
     {
292
-        $object=debug_backtrace()[1]['object'];
292
+        $object = debug_backtrace()[1]['object'];
293 293
         return new ResponseOutManager($object);
294 294
     }
295 295
 }
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
      * @throws \DI\DependencyException
305 305
      * @throws \DI\NotFoundException
306 306
      */
307
-    function resolve($class,$bind=array())
307
+    function resolve($class, $bind = array())
308 308
     {
309
-        return app()->resolve($class,$bind);
309
+        return app()->resolve($class, $bind);
310 310
     }
311 311
 }
312 312
 
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
      * @param $key
317 317
      * @return mixed
318 318
      */
319
-    function route($key=null)
319
+    function route($key = null)
320 320
     {
321
-        return array_map(function($route){
321
+        return array_map(function($route) {
322 322
             return strtolower($route);
323 323
         },app()->singleton()->appClass->route($key));
324 324
     }
@@ -342,10 +342,10 @@  discard block
 block discarded – undo
342 342
      * @param null $default
343 343
      * @return mixed
344 344
      */
345
-    function post($param=null,$default=null)
345
+    function post($param = null, $default = null)
346 346
     {
347 347
         //symfony request query object
348
-        $post=core()->post;
348
+        $post = core()->post;
349 349
 
350 350
         return ($param===null) ? $post : (isset($post[$param]) ? $post[$param] : $default);
351 351
     }
@@ -376,8 +376,8 @@  discard block
 block discarded – undo
376 376
      * @param array $select
377 377
      * @return mixed
378 378
      */
379
-    function trans($lang,$select=array())
379
+    function trans($lang, $select = array())
380 380
     {
381
-        return app()->singleton()->appClass->translator($lang,$select);
381
+        return app()->singleton()->appClass->translator($lang, $select);
382 382
     }
383 383
 }
384 384
\ No newline at end of file
Please login to merge, or discard this patch.