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.

Issues (472)

app/Rules/RoleBelongsToGroup.php (17 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace BristolSU\Module\AssignRoles\Rules;
4
5
use BristolSU\ControlDB\Contracts\Repositories\Role as RoleRepository;
6
use BristolSU\Support\Authentication\Contracts\Authentication;
7
use Illuminate\Contracts\Validation\Rule;
8
9
/**
10
 * Test if a role belongs to a group
11
 * 
12
 * @package BristolSU\Module\AssignRoles\Rules
13
 */
0 ignored issues
show
Missing @category tag in class comment
Loading history...
Missing @author tag in class comment
Loading history...
Missing @license tag in class comment
Loading history...
Missing @link tag in class comment
Loading history...
14
class RoleBelongsToGroup implements Rule
15
{
16
17
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
18
     * @var RoleRepository
19
     */
20
    private $roleRepository;
0 ignored issues
show
Private member variable "roleRepository" must be prefixed with an underscore
Loading history...
21
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
22
     * @var Authentication
23
     */
24
    private $authentication;
0 ignored issues
show
Private member variable "authentication" must be prefixed with an underscore
Loading history...
25
26 24
    public function __construct(RoleRepository $roleRepository, Authentication $authentication)
0 ignored issues
show
Missing doc comment for function __construct()
Loading history...
27
    {
28 24
        $this->roleRepository = $roleRepository;
29 24
        $this->authentication = $authentication;
30 24
    }
31
32
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
Parameter $attribute should have a doc-comment as per coding-style.
Loading history...
Parameter $value should have a doc-comment as per coding-style.
Loading history...
33
     * @inheritDoc
34
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
35 24
    public function passes($attribute, $value)
36
    {
37 24
        $role = $this->roleRepository->getById($value);
38 24
        return $this->group()->id() === $role->groupId();
39
    }
40
41 24
    protected function group()
0 ignored issues
show
Missing doc comment for function group()
Loading history...
42
    {
43 24
        return $this->authentication->getGroup();
44
    }
45
46
    /**
0 ignored issues
show
Missing short description in doc comment
Loading history...
47
     * @inheritDoc
48
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
49 4
    public function message()
50
    {
51 4
        return 'The role does not belong to your group';
52
    }
53
}