Conditions | 3 |
Paths | 3 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
39 | 36 | public function fillWithSnakeParams(array $params, $glue = '_') |
|
40 | { |
||
41 | 36 | $thisObject = new \ReflectionClass($this); |
|
42 | 36 | $properties = $thisObject->getProperties(); |
|
43 | 36 | foreach ($properties as $property) { |
|
44 | 36 | $snakeProperty = $this->fromCamelCase($property->getName(), $glue); |
|
45 | 36 | if (isset($params[$snakeProperty])) { |
|
46 | 19 | $this->{$property->getName()} = $params[$snakeProperty]; |
|
47 | } |
||
50 | } |