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.

Authorizable   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 38
rs 10
c 1
b 0
f 1
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A can() 0 4 1
A cant() 0 4 1
A cannot() 0 4 1
1
<?php
2
3
namespace Milkmeowo\Framework\Base\Traits\Auth;
4
5
use Illuminate\Contracts\Auth\Access\Gate;
6
7
trait Authorizable
8
{
9
    /**
10
     * Determine if the entity has a given ability.
11
     *
12
     * @param  string  $ability
13
     * @param  array|mixed  $arguments
14
     * @return bool
15
     */
16
    public function can($ability, $arguments = [])
17
    {
18
        return app(Gate::class)->forUser($this)->check($ability, $arguments);
19
    }
20
21
    /**
22
     * Determine if the entity does not have a given ability.
23
     *
24
     * @param  string  $ability
25
     * @param  array|mixed  $arguments
26
     * @return bool
27
     */
28
    public function cant($ability, $arguments = [])
29
    {
30
        return ! $this->can($ability, $arguments);
31
    }
32
33
    /**
34
     * Determine if the entity does not have a given ability.
35
     *
36
     * @param  string  $ability
37
     * @param  array|mixed  $arguments
38
     * @return bool
39
     */
40
    public function cannot($ability, $arguments = [])
41
    {
42
        return $this->cant($ability, $arguments);
43
    }
44
}
45