Skip to content

Commit ca6bc90

Browse files
HP-2496: fixing Psalm
1 parent 0aff5ab commit ca6bc90

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/product/behavior/BehaviorRegistry.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66

77
use hiqdev\php\billing\product\trait\HasLockInterface;
88

9+
/**
10+
* @template TParentCollection
11+
* @implements HasBehaviorsInterface<TParentCollection>
12+
*/
913
abstract class BehaviorRegistry implements HasLockInterface, HasBehaviorsInterface
1014
{
15+
/**
16+
* @return BehaviorCollectionInterface<TParentCollection>
17+
*/
1118
abstract protected function getBehaviorCollection(): BehaviorCollectionInterface;
1219

1320
public function hasBehavior(string $behaviorClassName): bool
@@ -23,7 +30,7 @@ public function hasBehavior(string $behaviorClassName): bool
2330

2431
public function findBehaviorByClass(string $class)
2532
{
26-
foreach ($this->withBehaviors() as $behavior) {
33+
foreach ($this->getBehaviorCollection() as $behavior) {
2734
if ($behavior instanceof $class) {
2835
return $behavior;
2936
}

0 commit comments

Comments
 (0)