GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — develop ( 50df9e...3f084e )
by Toby
13:35
created
app/CompletionConditions/RequiredPositionsFilled.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
             $remainingPositions = $this->positionsStillToFill($settings, $activityInstance, $moduleInstance);
46 46
         } catch (SettingRetrievalException $e) {
47 47
             Log::debug(
48
-              sprintf(
48
+                sprintf(
49 49
                 'Setting could not be found for activity instance %d and module instance %d',
50 50
                 $activityInstance->id,
51 51
                 $moduleInstance->id()
52
-              )
52
+                )
53 53
             );
54 54
             return false;
55 55
         }
56 56
        
57 57
         Log::info('Result is ' . (count($remainingPositions) === 0 ? 'true' : 'false'));
58
-       return count($remainingPositions) === 0;
58
+        return count($remainingPositions) === 0;
59 59
     }
60 60
     
61 61
     public function percentage($settings, ActivityInstance $activityInstance, ModuleInstance $moduleInstance): int
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         
94 94
         Log::info('Roles to be used: ' . json_encode($roles->map(function($role) {
95 95
             return $role->id();
96
-          })));
96
+            })));
97 97
         
98 98
         Log::info('Required positions ' . (string) collect($this->getRequiredPositions($settings, $group)));
99 99
         return collect($this->getRequiredPositions($settings, $group))->filter(function(int $positionId) use ($roles) {
@@ -183,8 +183,8 @@  discard block
 block discarded – undo
183 183
     {
184 184
         $roles = $group->roles();
185 185
         Log::info('Roles through group pre logic filtering: ' . json_encode($roles->map(function($role) {
186
-              return $role->id();
187
-          })));
186
+                return $role->id();
187
+            })));
188 188
         if($this->logicGroupId($moduleInstance) !== null) {
189 189
             $logicGroup = app(LogicRepository::class)->getById($this->logicGroupId($moduleInstance));
190 190
             return $roles->filter(function(\BristolSU\ControlDB\Contracts\Models\Role $role) use ($moduleInstance, $logicGroup) {
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
         }
194 194
 
195 195
         Log::info('Roles through group post logic filtering: ' . json_encode($roles->map(function($role) {
196
-              return $role->id();
197
-          })));
196
+                return $role->id();
197
+            })));
198 198
         
199 199
         return $roles;
200 200
     }
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             return false;
55 55
         }
56 56
        
57
-        Log::info('Result is ' . (count($remainingPositions) === 0 ? 'true' : 'false'));
57
+        Log::info('Result is '.(count($remainingPositions) === 0 ? 'true' : 'false'));
58 58
        return count($remainingPositions) === 0;
59 59
     }
60 60
     
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
             return false;
70 70
         }
71 71
         
72
-        if(count($requiredPositions) === 0) {
72
+        if (count($requiredPositions) === 0) {
73 73
             return 100;
74 74
         }
75 75
         
76 76
         $filled = count($requiredPositions) - count($remainingPositions);
77 77
         
78
-        $percentage = (int) round(($filled/count($requiredPositions)) * 100, 0);
78
+        $percentage = (int) round(($filled / count($requiredPositions)) * 100, 0);
79 79
 
80
-        if($percentage > 100) {
80
+        if ($percentage > 100) {
81 81
             return 100;
82 82
         }
83 83
         return $percentage;
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
     protected function positionsStillToFill($settings, ActivityInstance $activityInstance, ModuleInstance $moduleInstance)
87 87
     {
88 88
         $group = $this->getGroup($activityInstance);
89
-        Log::info('Using group ' . $group->id());
89
+        Log::info('Using group '.$group->id());
90 90
         $roles = $this->rolesThroughGroup($group, $moduleInstance)->filter(function(Role $role) {
91 91
             return $role->users()->count() > 0;
92 92
         });
93 93
         
94
-        Log::info('Roles to be used: ' . json_encode($roles->map(function($role) {
94
+        Log::info('Roles to be used: '.json_encode($roles->map(function($role) {
95 95
             return $role->id();
96 96
           })));
97 97
         
98
-        Log::info('Required positions ' . (string) collect($this->getRequiredPositions($settings, $group)));
98
+        Log::info('Required positions '.(string) collect($this->getRequiredPositions($settings, $group)));
99 99
         return collect($this->getRequiredPositions($settings, $group))->filter(function(int $positionId) use ($roles) {
100 100
             return $roles->filter(function(Role $role) use ($positionId) {
101 101
                 return $role->positionId() === $positionId;
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     private function getGroup(ActivityInstance $activityInstance)
170 170
     {
171
-        if($activityInstance->resource_type === 'group') {
171
+        if ($activityInstance->resource_type === 'group') {
172 172
             return $activityInstance->participant();
173 173
         }
174 174
         return $activityInstance->participant()->group();
@@ -182,17 +182,17 @@  discard block
 block discarded – undo
182 182
     private function rolesThroughGroup(Group $group, ModuleInstance $moduleInstance)
183 183
     {
184 184
         $roles = $group->roles();
185
-        Log::info('Roles through group pre logic filtering: ' . json_encode($roles->map(function($role) {
185
+        Log::info('Roles through group pre logic filtering: '.json_encode($roles->map(function($role) {
186 186
               return $role->id();
187 187
           })));
188
-        if($this->logicGroupId($moduleInstance) !== null) {
188
+        if ($this->logicGroupId($moduleInstance) !== null) {
189 189
             $logicGroup = app(LogicRepository::class)->getById($this->logicGroupId($moduleInstance));
190 190
             return $roles->filter(function(\BristolSU\ControlDB\Contracts\Models\Role $role) use ($moduleInstance, $logicGroup) {
191 191
                 return LogicTester::evaluate($logicGroup, null, $role->group(), $role);
192 192
             })->values();
193 193
         }
194 194
 
195
-        Log::info('Roles through group post logic filtering: ' . json_encode($roles->map(function($role) {
195
+        Log::info('Roles through group post logic filtering: '.json_encode($roles->map(function($role) {
196 196
               return $role->id();
197 197
           })));
198 198
         
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     private function logicGroupId(ModuleInstance $moduleInstance)
203 203
     {
204 204
         $id = $moduleInstance->setting('logic_group', null);
205
-        if($id === null) {
205
+        if ($id === null) {
206 206
             return null;
207 207
         }
208 208
         return (int) $id;
Please login to merge, or discard this patch.