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.

OldFileController::index()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
nc 3
nop 0
dl 0
loc 13
c 1
b 0
f 0
cc 3
rs 9.9666
ccs 8
cts 8
cp 1
crap 3
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\Module\UploadFile\Http\Controllers\ParticipantApi;
4
5
use BristolSU\Module\UploadFile\Http\Controllers\Controller;
6
use BristolSU\Module\UploadFile\Models\File;
7
8
class OldFileController extends Controller
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class OldFileController
Loading history...
9
{
10
11 1
    public function index()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function index()
Loading history...
12
    {
13 1
        $files = collect();
14 1
        foreach(settings('tags_to_merge', []) as $tag) {
0 ignored issues
show
Coding Style introduced by
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
15 1
            foreach(File::withTag($tag)->get() as $file) {
0 ignored issues
show
Coding Style introduced by
Expected "foreach (...) {\n"; found "foreach(...) {\n"
Loading history...
16 1
                $files->push($file);
17
            }
18
        }
19
        return $files->unique(function(File $file) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
20 1
            return $file->id;
21
        })->map(function(File $file) {
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
22 1
            return $file->load(['statuses', 'comments']);
23 1
        })->values();
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
24
    }
25
26
}