| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 1 | public function getPropertyArray(): array |
|
| 43 | { |
||
| 44 | 1 | $reflection = new \ReflectionClass(__CLASS__); |
|
| 45 | 1 | $properties = $reflection->getProperties(\ReflectionProperty::IS_PROTECTED); |
|
| 46 | 1 | $data = []; |
|
| 47 | 1 | foreach($properties as $property){ |
|
| 48 | 1 | $prop_name = $property->getName(); |
|
| 49 | 1 | $method = sprintf('get%s', ucfirst($prop_name)); |
|
| 50 | 1 | $form_name = strtolower(preg_replace('/[A-Z]/', '_$0', $prop_name)); |
|
| 51 | 1 | if($reflection->hasMethod($method)){ |
|
| 52 | 1 | $data[$form_name] = $this->{$method}(); |
|
| 53 | } |
||
| 54 | } |
||
| 55 | 1 | return $data; |
|
| 56 | } |
||
| 59 |