We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 4 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 38 | protected function populate(array $config): void |
|
22 | { |
||
23 | 38 | foreach ($config as $key => $value) { |
|
24 | 38 | $property = lcfirst(str_replace('_', '', ucwords($key, '_'))); |
|
25 | 38 | $normalizer = static::NORMALIZERS[$property] ?? 'normalize'.ucfirst($property); |
|
26 | 38 | if (method_exists($this, $normalizer)) { |
|
27 | 38 | $this->$property = $this->$normalizer($value); |
|
28 | 38 | } elseif (property_exists($this, $property)) { |
|
29 | 38 | $this->$property = $value; |
|
30 | } else { |
||
31 | throw new InvalidArgumentException(sprintf('Unknown config "%s".', $property)); |
||
32 | } |
||
49 |