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 — master ( f62fd7...39e50f )
by Toby
22:08
created
app/CompletionConditions/NumberOfDocumentsSubmitted.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
     public function percentage($settings, ActivityInstance $activityInstance, ModuleInstance $moduleInstance): int
20 20
     {
21 21
         $count = File::forResource($activityInstance->id, $moduleInstance->id)->count();
22
-        $needed = ( $settings['number_of_files'] ?? 1);
22
+        $needed = ($settings['number_of_files'] ?? 1);
23 23
 
24
-        $percentage = (int) round(($count/$needed) * 100, 0);
24
+        $percentage = (int) round(($count / $needed) * 100, 0);
25 25
 
26
-        if($percentage > 100) {
26
+        if ($percentage > 100) {
27 27
             return 100;
28 28
         }
29 29
         return $percentage;
Please login to merge, or discard this patch.
app/CompletionConditions/NumberOfDocumentsWithStatus.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@
 block discarded – undo
23 23
         $count = File::forResource($activityInstance->id, $moduleInstance->id())->get()->filter(function(File $file) use ($settings) {
24 24
             return $file->status === $settings['status'];
25 25
         })->count();
26
-        $needed = ( $settings['number_of_files'] ?? 1);
26
+        $needed = ($settings['number_of_files'] ?? 1);
27 27
 
28
-        $percentage = (int) round(($count/$needed) * 100, 0);
28
+        $percentage = (int) round(($count / $needed) * 100, 0);
29 29
 
30
-        if($percentage > 100) {
30
+        if ($percentage > 100) {
31 31
             return 100; 
32 32
         }
33 33
         return $percentage;
Please login to merge, or discard this patch.
app/Http/Controllers/ParticipantApi/FileController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $this->authorize('file.destroy');
54 54
 
55
-        if((int) $file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
55
+        if ((int) $file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
56 56
             throw new AuthorizationException();
57 57
         }
58 58
                 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $this->authorize('file.index');
70 70
 
71
-        if((int) $file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
71
+        if ((int) $file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
72 72
             throw new AuthorizationException();
73 73
         }
74 74
         
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $this->authorize('file.update');
81 81
 
82
-        if((int) $file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
82
+        if ((int) $file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
83 83
             throw new AuthorizationException();
84 84
         }
85 85
         
Please login to merge, or discard this patch.
app/Http/Controllers/ParticipantApi/CommentController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public function index(Request $request, Activity $activity, ModuleInstance $moduleInstance, File $file)
22 22
     {
23 23
         $this->authorize('comment.index');
24
-        if ((int)$file->activity_instance_id !== (int)app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
24
+        if ((int) $file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
25 25
             throw new AuthorizationException();
26 26
         }
27 27
         return $file->comments;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->authorize('comment.destroy');
47 47
 
48
-        if ((int)$comment->file->activity_instance_id !== (int)app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
48
+        if ((int) $comment->file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
49 49
             throw new AuthorizationException();
50 50
         }
51 51
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         $this->authorize('comment.update');
62 62
 
63
-        if ((int)$comment->file->activity_instance_id !== (int)app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
63
+        if ((int) $comment->file->activity_instance_id !== (int) app(ActivityInstanceResolver::class)->getActivityInstance()->id) {
64 64
             throw new AuthorizationException();
65 65
         }
66 66
 
Please login to merge, or discard this patch.
app/Http/Controllers/Participant/ParticipantPageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     {
12 12
         $this->authorize('view-page');
13 13
         
14
-        return view(alias() . '::participant');
14
+        return view(alias().'::participant');
15 15
     }
16 16
     
17 17
 }
18 18
\ No newline at end of file
Please login to merge, or discard this patch.
app/Http/Controllers/Controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     public function authorize($ability, $arguments = [])
18 18
     {
19 19
         return $this->baseAuthorize(
20
-            alias() . '.' . $ability,
20
+            alias().'.'.$ability,
21 21
             $arguments
22 22
         );
23 23
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/DownloadFileController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     {
17 17
         $this->authorize('admin.file.download');
18 18
         
19
-        if(Storage::exists($file->path)) {
19
+        if (Storage::exists($file->path)) {
20 20
             return Storage::download($file->path, $file->filename, [
21 21
                 'X-Vapor-Base64-Encode' => 'True'
22 22
             ]);
Please login to merge, or discard this patch.
database/factories/FileFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use BristolSU\Module\UploadFile\Models\File;
4 4
 use Faker\Generator as Faker;
5 5
 
6
-$factory->define(File::class, function (Faker $faker) {
6
+$factory->define(File::class, function(Faker $faker) {
7 7
     return [
8 8
         'title' => $faker->sentence,
9 9
         'description' => $faker->sentence,
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
         'uploaded_by' => function() {
15 15
             return factory(\BristolSU\ControlDB\Models\User::class)->create()->id();
16 16
         },
17
-        'module_instance_id' => function () {
17
+        'module_instance_id' => function() {
18 18
             return factory(\BristolSU\Support\ModuleInstance\ModuleInstance::class)->create()->id;
19 19
         },
20
-        'activity_instance_id' => function () {
20
+        'activity_instance_id' => function() {
21 21
             return factory(\BristolSU\Support\ActivityInstance\ActivityInstance::class)->create()->id;
22 22
         },
23 23
         'tags' => $faker->randomElements(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'], 4)
Please login to merge, or discard this patch.
app/ModuleServiceProvider.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@
 block discarded – undo
256 256
             )->withField(
257 257
                 Field::checkList('allowed_extensions')->label('Allowed file types')->hint('Which file types can be uploaded?')
258 258
                     ->listBox(true)->values($this->app['config']->get($this->alias() . '.file_types'))
259
-		                ->default(['doc', 'docx', 'odt', 'rtf', 'txt', 'csv', 'ppt', 'pptx', 'pdf', 'xls'])
259
+                        ->default(['doc', 'docx', 'odt', 'rtf', 'txt', 'csv', 'ppt', 'pptx', 'pdf', 'xls'])
260 260
             )
261 261
         )->withGroup(
262 262
             Group::make('Status Changes')->withField(
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     
194 194
     public function baseDirectory()
195 195
     {
196
-        return __DIR__ . '/..';
196
+        return __DIR__.'/..';
197 197
     }
198 198
 
199 199
     public function register()
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         
217 217
         Route::bind('uploadfile_file', function($id) {
218 218
             $file = File::findOrFail($id);
219
-            if(request()->route('module_instance_slug') && (int) $file->module_instance_id === request()->route('module_instance_slug')->id()) {
219
+            if (request()->route('module_instance_slug') && (int) $file->module_instance_id === request()->route('module_instance_slug')->id()) {
220 220
                 return $file;
221 221
             }
222 222
             throw (new ModelNotFoundException)->setModel(File::class);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             
228 228
             $currentActivityInstance = app(ActivityInstanceResolver::class)->getActivityInstance();
229 229
             $fileActivityInstance = $file->activityInstance();
230
-            if($currentActivityInstance->resource_type === $fileActivityInstance->resource_type
230
+            if ($currentActivityInstance->resource_type === $fileActivityInstance->resource_type
231 231
                 && (int) $currentActivityInstance->resource_id === (int) $fileActivityInstance->resource_id) {
232 232
                 return $file;
233 233
             }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         
237 237
         Route::bind('uploadfile_file_status', function($id) {
238 238
             $fileStatus = FileStatus::findOrFail($id);
239
-            if(request()->route('module_instance_slug') && (int) $fileStatus->file->module_instance_id === request()->route('module_instance_slug')->id()) {
239
+            if (request()->route('module_instance_slug') && (int) $fileStatus->file->module_instance_id === request()->route('module_instance_slug')->id()) {
240 240
                 return $fileStatus;
241 241
             }
242 242
             throw (new ModelNotFoundException)->setModel(FileStatus::class);
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
         
245 245
         Route::bind('uploadfile_comment', function($id) {
246 246
             $comment = Comment::findOrFail($id);
247
-            if(request()->route('module_instance_slug') && (int) $comment->file->module_instance_id === request()->route('module_instance_slug')->id()) {
247
+            if (request()->route('module_instance_slug') && (int) $comment->file->module_instance_id === request()->route('module_instance_slug')->id()) {
248 248
                 return $comment;
249 249
             }
250 250
             throw (new ModelNotFoundException)->setModel(Comment::class);
@@ -264,20 +264,20 @@  discard block
 block discarded – undo
264 264
             Group::make('New Documents')->withField(
265 265
                 Field::input('document_title')->inputType('text')->label('Default document title')->hint('This will be the default title of a new file')->default('Document')
266 266
             )->withField(
267
-                Field::switch('multiple_files')->label('Multiple Files')->hint('Should multiple files be able to be uploaded at the same time?')
267
+                Field::switch ('multiple_files')->label('Multiple Files')->hint('Should multiple files be able to be uploaded at the same time?')
268 268
                     ->textOn('Allow')->textOff('Do not allow')->default(true)
269 269
             )->withField(
270 270
                 Field::checkList('allowed_extensions')->label('Allowed file types')->hint('Which file types can be uploaded?')
271
-                    ->listBox(true)->values($this->app['config']->get($this->alias() . '.file_types'))
271
+                    ->listBox(true)->values($this->app['config']->get($this->alias().'.file_types'))
272 272
 		                ->default(['doc', 'docx', 'odt', 'rtf', 'txt', 'csv', 'ppt', 'pptx', 'pdf', 'xls'])
273 273
             )
274 274
         )->withGroup(
275 275
             Group::make('Status Changes')->withField(
276 276
                 Field::input('initial_status')->inputType('select')->label('Initial Status')->hint('What status should all new files have?')
277
-                        ->default('Awaiting Approval')->values($this->app['config']->get($this->alias() . '.statuses'))
277
+                        ->default('Awaiting Approval')->values($this->app['config']->get($this->alias().'.statuses'))
278 278
             )->withField(
279 279
                 Field::checkList('statuses')->label('Available Statuses')->hint('A list of available statuses')
280
-                    ->listBox(true)->values($this->app['config']->get($this->alias() . '.statuses'))
280
+                    ->listBox(true)->values($this->app['config']->get($this->alias().'.statuses'))
281 281
             )
282 282
         )->withGroup(
283 283
             Group::make('Tags')->withField(
Please login to merge, or discard this patch.