| Total Complexity | 8 |
| Total Lines | 67 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class BlocklistProcessor |
||
| 9 | { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @var BlocklistChecker[]|array |
||
| 13 | */ |
||
| 14 | protected array $checkers = []; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * BlocklistChecker constructor. |
||
| 18 | * @param array $checkers |
||
| 19 | */ |
||
| 20 | 3 | public function __construct(array $checkers = []) |
|
| 21 | { |
||
| 22 | 3 | $this->checkers = $checkers; |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return array |
||
| 27 | */ |
||
| 28 | 1 | public function getCheckers(): array |
|
| 29 | { |
||
| 30 | 1 | return $this->checkers; |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @param array $checkers |
||
| 35 | * |
||
| 36 | * @return static |
||
| 37 | */ |
||
| 38 | 1 | public function setCheckers(array $checkers): static |
|
| 39 | { |
||
| 40 | 1 | $this->checkers = $checkers; |
|
| 41 | |||
| 42 | 1 | return $this; |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param BlocklistChecker $checker |
||
| 47 | * @return static |
||
| 48 | */ |
||
| 49 | 1 | public function addChecker(BlocklistChecker $checker): static |
|
| 50 | { |
||
| 51 | 1 | array_push($this->checkers, $checker); |
|
| 52 | |||
| 53 | 1 | return $this; |
|
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param $entity |
||
| 58 | * |
||
| 59 | * @return bool |
||
| 60 | * @throws InvalidArgumentException |
||
| 61 | */ |
||
| 62 | 2 | public function passed($entity): bool |
|
| 75 | } |
||
| 76 | } |
||
| 77 |