| Conditions | 4 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public static function configure($object, array $config = []) |
||
| 23 | { |
||
| 24 | foreach ($config as $key => $val) { |
||
| 25 | $setter = 'set' . $key; |
||
| 26 | if (method_exists($object, $setter)) { |
||
| 27 | $object->$setter($val); |
||
| 28 | } elseif (property_exists($object, $key)) { |
||
| 29 | $object->$key = $val; |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 33 | } |
||
| 34 |