Completed
Push — master ( 0836e9...dee3ba )
by Park Jong-Hun
03:11
created

FileBasePermissionManager   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRolesByAction() 0 4 2
1
<?php
2
3
namespace App\Auth\PermissionManager;
4
5
use App\Auth\PermissionManager;
6
7
class FileBasePermissionManager extends PermissionManager
8
{
9
    private $permission;
10
11
    public function __construct($settings = [])
12
    {
13
        $this->permission = $settings['permissions'];
14
    }
15
16
    /**
17
     * @return array|null
18
     */
19
    public function getRolesByAction($action)
20
    {
21
        return isset($this->permission[$action]) ? $this->permission[$action] : null;
22
    }
23
}
24