| Conditions | 5 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function findPropertyBinding($property): ?IPropertyValueBinding |
||
| 24 | { |
||
| 25 | assert( |
||
| 26 | $property instanceof IProperty || is_string($property), /** @phpstan-ignore-line */ |
||
| 27 | 'The property to search for must either be a string representing the name or IProperty' . |
||
| 28 | ' representing the property' |
||
| 29 | ); |
||
| 30 | /** @var string $nuProperty */ |
||
| 31 | $nuProperty = $property instanceof IProperty ? $property->getName() : $property; |
||
| 32 | foreach ($this->getPropertyValueBindings() as $propertyBinding) { |
||
| 33 | $prop = $propertyBinding->getBoundProperty(); |
||
| 34 | if ($prop->getName() == $nuProperty) { |
||
| 35 | return $propertyBinding; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | return null; |
||
| 39 | } |
||
| 46 |