Passed
Branch master (664440)
by Musa
01:47
created
src/AutoPolicyProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     protected function getPolicyMap() {
39 39
         // Try to to get the cached map if there is one
40
-        if(Cache::has(self::CACHE_KEY) && !App::isLocal()) {
40
+        if (Cache::has(self::CACHE_KEY) && !App::isLocal()) {
41 41
             return Cache::get(self::CACHE_KEY);
42 42
         }
43 43
 
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
         // Initialize the policy map
48 48
         $map = [];
49 49
 
50
-        foreach($policies as $policy) {
50
+        foreach ($policies as $policy) {
51 51
             $data = $this->getPolicyData($policy);
52 52
 
53 53
             // Check if the model is not being used as a duplicate
54
-            if(isset($map[$data['model']]))
54
+            if (isset($map[$data['model']]))
55 55
                 throw new Exception('The model "' . $data['model'] . '" is being used for more than one policy."');
56 56
 
57 57
             // Assign the policy its spot in the policy map
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         }
60 60
 
61 61
         // Cache the map and return it
62
-        if(!App::isLocal())
62
+        if (!App::isLocal())
63 63
             Cache::put(self::CACHE_KEY, $map, self::CACHE_TIME);
64 64
 
65 65
         return $map;
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $path = app_path('Policies');
75 75
 
76 76
         // Return an empty array if there are no policies at all
77
-        if(!file_exists($path))
77
+        if (!file_exists($path))
78 78
             return [];
79 79
 
80 80
         // Scan for policies
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
         // Remove hidden items
84 84
         foreach ($policies as $key => $policy)
85
-            if(starts_with($policy, '.')) unset($policies[$key]);
85
+            if (starts_with($policy, '.')) unset($policies[$key]);
86 86
 
87 87
         return $policies;
88 88
     }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         // Attempt to get the model
108 108
         $model = $reflection->getConstant('MODEL');
109 109
 
110
-        if(!$model) throw new Exception('The policy "' . $policyClassName . '" is not bound to any model.');
110
+        if (!$model) throw new Exception('The policy "' . $policyClassName . '" is not bound to any model.');
111 111
 
112 112
         // Return the policy data
113 113
         return [
Please login to merge, or discard this patch.