| Total Complexity | 3 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class Force |
||
| 19 | { |
||
| 20 | /** @var string $resource */ |
||
| 21 | protected $resource; |
||
| 22 | |||
| 23 | /** @var bool $allowed */ |
||
| 24 | protected $allowed; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Constructor |
||
| 28 | * |
||
| 29 | * @param string $resource What is granted permission to |
||
| 30 | * @param bool $allowed True or false |
||
| 31 | */ |
||
| 32 | public function __construct(string $resource, bool $allowed = true) |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Check if allowed i.e. user matches. |
||
| 40 | * |
||
| 41 | * @param string $resource Resource to check |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | public function check(string $resource): bool |
||
| 53 |