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.

UserTagController::show()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace BristolSU\ControlDB\Http\Controllers\UserTag;
4
5
use BristolSU\ControlDB\Http\Controllers\Controller;
6
use BristolSU\ControlDB\Contracts\Models\Tags\UserTag;
7
use BristolSU\ControlDB\Contracts\Repositories\Tags\UserTag as UserTagRepository;
8
use BristolSU\ControlDB\Http\Requests\Api\UserTag\UserTagStoreRequest;
9
use BristolSU\ControlDB\Http\Requests\Api\UserTag\UserTagUpdateRequest;
10
11
/**
12
 * Handle user tags
13
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
14
class UserTagController extends Controller
15
{
16
17
    /**
18
     * Get all user tags
19
     * 
20
     * @param UserTagRepository $userTagRepository
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
21
     * @return \Illuminate\Pagination\LengthAwarePaginator
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
22
     */
23 1
    public function index(UserTagRepository $userTagRepository)
24
    {
25 1
        return $this->paginate($userTagRepository->all());
26
    }
27
28
    /**
29
     * Show information about a single user tag
30
     * 
31
     * @param UserTag $userTag
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
32
     * @return UserTag
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
33
     */
34 1
    public function show(UserTag $userTag)
35
    {
36 1
        return $userTag;
37
    }
38
39
    /**
40
     * Create a new user tag
41
     * 
42
     * @param UserTagStoreRequest $request
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
43
     * @param UserTagRepository $userTagRepository
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 3 spaces after parameter type; 1 found
Loading history...
44
     * @return UserTag
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
45
     */
46 1
    public function store(UserTagStoreRequest $request, UserTagRepository $userTagRepository)
47
    {
48 1
        return $userTagRepository->create(
49 1
            $request->input('name'),
50 1
            $request->input('description'),
51 1
            $request->input('reference'),
52 1
            $request->input('tag_category_id')
53
        );
54
    }
55
56
    /**
57
     * Update a user tag
58
     * 
59
     * @param UserTag $userTag
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 14 spaces after parameter type; 1 found
Loading history...
60
     * @param UserTagUpdateRequest $request
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
61
     * @return UserTag
0 ignored issues
show
Coding Style introduced by
Tag @return cannot be grouped with parameter tags in a doc comment
Loading history...
62
     */
63 1
    public function update(UserTag $userTag, UserTagUpdateRequest $request)
64
    {
65 1
        if($request->input('name') !== null) {
0 ignored issues
show
Coding Style introduced by
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
66 1
            $userTag->setName($request->input('name'));
67
        }
68 1
        if($request->input('description') !== null) {
0 ignored issues
show
Coding Style introduced by
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
69 1
            $userTag->setDescription($request->input('description'));
70
        }
71 1
        if($request->input('reference') !== null) {
0 ignored issues
show
Coding Style introduced by
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
72 1
            $userTag->setReference($request->input('reference'));
73
        }
74 1
        if($request->input('tag_category_id') !== null) {
0 ignored issues
show
Coding Style introduced by
Expected "if (...) {\n"; found "if(...) {\n"
Loading history...
75 1
            $userTag->setTagCategoryId($request->input('tag_category_id'));
76
        }
77
78 1
        return $userTag;
79
    }
80
81
    /**
82
     * Delete a user tag
83
     * 
84
     * @param UserTag $userTag
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Expected 11 spaces after parameter type; 1 found
Loading history...
85
     * @param UserTagRepository $userTagRepository
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
86
     */
0 ignored issues
show
Coding Style introduced by
Missing @return tag in function comment
Loading history...
87 1
    public function destroy(UserTag $userTag, UserTagRepository $userTagRepository)
88
    {
89 1
        $userTagRepository->delete((int) $userTag->id());
90 1
    }
91
92
}
93