| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | 6 | protected function getMetadataByName(array $object, $key) |
|
| 49 | { |
||
| 50 | 6 | $method = 'get' . ucfirst($key); |
|
| 51 | |||
| 52 | 6 | if ( ! method_exists($this->filesystem, $method)) { |
|
| 53 | 3 | throw new \InvalidArgumentException('Could not get meta-data for key: ' . $key); |
|
| 54 | } |
||
| 55 | |||
| 56 | 3 | $object[$key] = $this->filesystem->{$method}($object['path']); |
|
| 57 | |||
| 58 | 3 | return $object; |
|
| 59 | } |
||
| 60 | } |
||
| 61 |