Passed
Pull Request — master (#2)
by Adam
04:39 queued 02:59
created
src/UrlGenerator.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
         $expires = Arr::get($request->query(), 'expires');
215 215
         $signature = hash_hmac('sha256', $original, call_user_func($this->keyResolver));
216
-        return  hash_equals($signature, $request->query('signature', '')) && ! ($expires && Carbon::now()->getTimestamp() > $expires);
216
+        return  hash_equals($signature, $request->query('signature', '')) && !($expires && Carbon::now()->getTimestamp() > $expires);
217 217
     }
218 218
     
219 219
     /**
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
     public function hasValidParameterSignature(Request $request, array $parameters = [])
223 223
     {
224 224
         // we'll bail here as we need at least one
225
-        if(count($parameters) === 0) return true;
225
+        if (count($parameters) === 0) return true;
226 226
 
227
-        foreach($parameters as $parameter) {
227
+        foreach ($parameters as $parameter) {
228 228
             // if the request has the parameter or
229 229
             // the route has the parameter we check the signature
230
-            if($request->has($parameter) || strlen($request->route($parameter)) > 0) return $this->hasValidSignature($request);
230
+            if ($request->has($parameter) || strlen($request->route($parameter)) > 0) return $this->hasValidSignature($request);
231 231
         }
232 232
 
233 233
         return true;
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -222,12 +222,16 @@
 block discarded – undo
222 222
     public function hasValidParameterSignature(Request $request, array $parameters = [])
223 223
     {
224 224
         // we'll bail here as we need at least one
225
-        if(count($parameters) === 0) return true;
225
+        if(count($parameters) === 0) {
226
+            return true;
227
+        }
226 228
 
227 229
         foreach($parameters as $parameter) {
228 230
             // if the request has the parameter or
229 231
             // the route has the parameter we check the signature
230
-            if($request->has($parameter) || strlen($request->route($parameter)) > 0) return $this->hasValidSignature($request);
232
+            if($request->has($parameter) || strlen($request->route($parameter)) > 0) {
233
+                return $this->hasValidSignature($request);
234
+            }
231 235
         }
232 236
 
233 237
         return true;
Please login to merge, or discard this patch.
src/Arr.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         foreach ($array as $values) {
52 52
             if ($values instanceof Collection) {
53 53
                 $values = $values->all();
54
-            } elseif (! is_array($values)) {
54
+            } elseif (!is_array($values)) {
55 55
                 continue;
56 56
             }
57 57
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $results = [];
112 112
 
113 113
         foreach ($array as $key => $value) {
114
-            if (is_array($value) && ! empty($value)) {
114
+            if (is_array($value) && !empty($value)) {
115 115
                 $results = array_merge($results, static::dot($value, $prepend.$key.'.'));
116 116
             } else {
117 117
                 $results[$prepend.$key] = $value;
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         foreach ($array as $item) {
212 212
             $item = $item instanceof Collection ? $item->all() : $item;
213 213
 
214
-            if (! is_array($item)) {
214
+            if (!is_array($item)) {
215 215
                 $result[] = $item;
216 216
             } elseif ($depth === 1) {
217 217
                 $result = array_merge($result, array_values($item));
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      */
278 278
     public static function get($array, $key, $default = null)
279 279
     {
280
-        if (! static::accessible($array)) {
280
+        if (!static::accessible($array)) {
281 281
             return value($default);
282 282
         }
283 283
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
         $keys = (array) $keys;
321 321
 
322
-        if (! $array) {
322
+        if (!$array) {
323 323
             return false;
324 324
         }
325 325
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
             // If the key doesn't exist at this depth, we will just create an empty array
526 526
             // to hold the next value, allowing us to create the arrays to hold final
527 527
             // values at the correct depth. Then we'll keep digging into the array.
528
-            if (! isset($array[$key]) || ! is_array($array[$key])) {
528
+            if (!isset($array[$key]) || !is_array($array[$key])) {
529 529
                 $array[$key] = [];
530 530
             }
531 531
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
         } else {
552 552
             srand($seed);
553 553
 
554
-            usort($array, function () {
554
+            usort($array, function() {
555 555
                 return rand(-1, 1);
556 556
             });
557 557
         }
@@ -629,6 +629,6 @@  discard block
 block discarded – undo
629 629
             return [];
630 630
         }
631 631
 
632
-        return ! is_array($value) ? [$value] : $value;
632
+        return !is_array($value) ? [$value] : $value;
633 633
     }
634 634
 }
635 635
\ No newline at end of file
Please login to merge, or discard this patch.
src/Support/helpers.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use Endeavors\Support\VO\Time\Week;
4 4
 use Endeavors\Support\VO\Time\Day;
5 5
 
6
-if(! function_exists('signed_route') ) {
6
+if (!function_exists('signed_route')) {
7 7
     /**
8 8
      * Create a signed route URL for a named route.
9 9
      *
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     }
20 20
 }
21 21
 
22
-if(! function_exists('temporary_signed_route') ) {
22
+if (!function_exists('temporary_signed_route')) {
23 23
     /**
24 24
      * Create a temporary signed route URL for a named route.
25 25
      *
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
     }
36 36
 }
37 37
 
38
-if(! function_exists('one_week_route') ) {
38
+if (!function_exists('one_week_route')) {
39 39
     /**
40 40
      * Create a temporary signed route URL for a named route.
41 41
      *
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     }
54 54
 }
55 55
 
56
-if(! function_exists('one_day_route') ) {
56
+if (!function_exists('one_day_route')) {
57 57
     /**
58 58
      * Create a temporary signed route URL for a named route.
59 59
      *
Please login to merge, or discard this patch.
src/FoundationServiceProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
      */
41 41
     protected function configureFormRequests()
42 42
     {
43
-        $this->app->afterResolving(function (ValidatesWhenResolved $resolved) {
43
+        $this->app->afterResolving(function(ValidatesWhenResolved $resolved) {
44 44
             $resolved->validate();
45 45
         });
46 46
 
47
-        $this->app->resolving(function (FormRequest $request, $app) {
47
+        $this->app->resolving(function(FormRequest $request, $app) {
48 48
             $this->initializeRequest($request, $app['request']);
49 49
 
50 50
             $request->setContainer($app)->setRedirector($app->make(Redirector::class));
@@ -85,20 +85,20 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function registerRequestSignatureValidation()
87 87
     {
88
-        FormRequest::macro('hasValidSignature', function () {
88
+        FormRequest::macro('hasValidSignature', function() {
89 89
             return URL::hasValidSignature($this ?? URL::getRequest());
90 90
         });
91 91
 
92
-        FormRequest::macro('hasInvalidSignature', function () {
93
-            return ! URL::hasValidSignature($this ?? URL::getRequest());
92
+        FormRequest::macro('hasInvalidSignature', function() {
93
+            return !URL::hasValidSignature($this ?? URL::getRequest());
94 94
         });
95 95
 
96
-        FormRequest::macro('hasValidParameterSignature', function (array $parameters = []) {
96
+        FormRequest::macro('hasValidParameterSignature', function(array $parameters = []) {
97 97
             return URL::hasValidParameterSignature($this ?? URL::getRequest(), $parameters);
98 98
         });
99 99
 
100
-        FormRequest::macro('hasInvalidParameterSignature', function (array $parameters = []) {
101
-            return ! URL::hasValidParameterSignature($this ?? URL::getRequest(), $parameters);
100
+        FormRequest::macro('hasInvalidParameterSignature', function(array $parameters = []) {
101
+            return !URL::hasValidParameterSignature($this ?? URL::getRequest(), $parameters);
102 102
         });
103 103
     }
104 104
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function registerRequestValidation()
111 111
     {
112
-        FormRequest::macro('validate', function (array $rules, ...$params) {
112
+        FormRequest::macro('validate', function(array $rules, ...$params) {
113 113
             return validator()->validate($this->all(), $rules, ...$params);
114 114
         });
115 115
     }
Please login to merge, or discard this patch.
src/RoutingServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      */
18 18
     protected function registerUrlGenerator()
19 19
     {
20
-        $this->app['url'] = $this->app->share(function ($app) {
20
+        $this->app['url'] = $this->app->share(function($app) {
21 21
             $routes = $app['router']->getRoutes();
22 22
             // The URL generator needs the route collection that exists on the router.
23 23
             // Keep in mind this is an object, so we're passing by references here
@@ -28,17 +28,17 @@  discard block
 block discarded – undo
28 28
                     'request', $this->requestRebinder()
29 29
                 )
30 30
             ));
31
-            $url->setSessionResolver(function () {
31
+            $url->setSessionResolver(function() {
32 32
                 return $this->app['session'];
33 33
             });
34 34
 
35
-            $url->setKeyResolver(function () {
35
+            $url->setKeyResolver(function() {
36 36
                 return $this->app->make('config')->get('app.key');
37 37
             });
38 38
             // If the route collection is "rebound", for example, when the routes stay
39 39
             // cached for the application, we will need to rebind the routes on the
40 40
             // URL generator instance so it has the latest version of the routes.
41
-            $app->rebinding('routes', function ($app, $routes) {
41
+            $app->rebinding('routes', function($app, $routes) {
42 42
                 $app['url']->setRoutes($routes);
43 43
             });
44 44
             return $url;
Please login to merge, or discard this patch.