Total Complexity | 7 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | abstract class BehaviorRegistry implements HasLockInterface, HasBehaviorsInterface |
||
14 | { |
||
15 | /** |
||
16 | * @return BehaviorCollectionInterface<TParentCollection> |
||
17 | */ |
||
18 | abstract protected function getBehaviorCollection(): BehaviorCollectionInterface; |
||
19 | |||
20 | public function hasBehavior(string $behaviorClassName): bool |
||
21 | { |
||
22 | foreach ($this->getBehaviorCollection() as $behavior) { |
||
23 | if ($behavior instanceof $behaviorClassName) { |
||
24 | return true; |
||
25 | } |
||
26 | } |
||
27 | |||
28 | return false; |
||
29 | } |
||
30 | |||
31 | public function findBehaviorByClass(string $class) |
||
40 | } |
||
41 | |||
42 | public function lock(): void |
||
47 |