Completed
Push — master ( f30036...f3ab2e )
by Chris
14s
created

UnauthorizedException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A forRoles() 0 4 1
A forPermissions() 0 4 1
A notLoggedIn() 0 4 1
1
<?php
2
3
namespace Spatie\Permission\Exceptions;
4
5
use Symfony\Component\HttpKernel\Exception\HttpException;
6
7
class UnauthorizedException extends HttpException
8
{
9
    public static function forRoles(array $roles): self
0 ignored issues
show
Unused Code introduced by
The parameter $roles is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
10
    {
11
        return new static(403, 'User does not have the right roles.', null, []);
12
    }
13
14
    public static function forPermissions(array $permissions): self
0 ignored issues
show
Unused Code introduced by
The parameter $permissions is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        return new static(403, 'User does not have the right permissions.', null, []);
17
    }
18
19
    public static function notLoggedIn(): self
20
    {
21
        return new static(403, 'User is not logged in.', null, []);
22
    }
23
}
24