Passed
Pull Request — master (#9)
by Pavel
11:27
created

AccessDeniedException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0
ccs 0
cts 9
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A rolesNeeded() 0 9 1
1
<?php
2
3
namespace Bankiru\Api\Rpc\Exception;
4
5
class AccessDeniedException extends \RuntimeException implements RpcException
6
{
7
    /**
8
     * @param string[] $roles
9
     *
10
     * @return static
11
     */
12
    public static function rolesNeeded(array $roles)
13
    {
14
        return new static(
15
            sprintf(
16
                'Insufficient privileges: required one of %s role to access this method',
17
                implode(', ', $roles)
18
            )
19
        );
20
    }
21
}
22