Conditions | 5 |
Paths | 5 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 3 | public function handle() |
|
33 | { |
||
34 | /** @var CanBeInBlocklist|Model $entity */ |
||
35 | 3 | foreach ($this->entities as $entity) { |
|
36 | 3 | if (!($entity instanceof $this->class)) { |
|
37 | 3 | $entity = $this->class::find($entity); |
|
38 | } |
||
39 | |||
40 | 3 | if (!$entity->isAllowlisted() && !$entity->getBlocklistProcessor()->passed($entity)) { |
|
41 | 3 | $entity->toBlocklist()->save(); |
|
42 | } |
||
46 |