| Total Complexity | 5 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class ClassReflectionExtension implements |
||
| 20 | BrokerAwareClassReflectionExtension, |
||
| 21 | PropertiesClassReflectionExtension |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var Broker |
||
| 25 | */ |
||
| 26 | private $broker; |
||
| 27 | |||
| 28 | public function setBroker(Broker $broker) : void |
||
| 29 | { |
||
| 30 | $this->broker = $broker; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function hasProperty( |
||
| 34 | ClassReflection $classReflection, |
||
| 35 | string $propertyName |
||
| 36 | ) : bool { |
||
| 37 | $className = $classReflection->getName(); |
||
| 38 | |||
| 39 | $property = ucfirst($propertyName); |
||
| 40 | |||
| 41 | return |
||
| 42 | is_a($className, DaftObject::class, true) && |
||
| 43 | ( |
||
| 44 | $classReflection->getNativeReflection()->hasMethod( |
||
| 45 | 'Get' . |
||
| 46 | $property |
||
| 47 | ) || |
||
| 48 | $classReflection->getNativeReflection()->hasMethod( |
||
| 49 | 'Set' . |
||
| 50 | $property |
||
| 51 | ) |
||
| 52 | ); |
||
| 53 | } |
||
| 54 | |||
| 55 | public function getProperty( |
||
| 63 | ); |
||
| 64 | } |
||
| 65 | } |
||
| 66 |