Conditions | 6 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 12 | protected function getReplacements(Record $record) |
|
26 | { |
||
27 | 12 | $replacements = []; |
|
28 | |||
29 | 12 | foreach ($record->getContext() as $key => $val) { |
|
30 | 11 | if (null === $val || is_scalar($val) || method_exists($val, '__toString')) { |
|
31 | 11 | $replacements['{'.$key.'}'] = $val; |
|
32 | 11 | } elseif (is_object($val)) { |
|
33 | 1 | $replacements['{'.$key.'}'] = '[object '.get_class($val).']'; |
|
34 | 1 | } else { |
|
35 | 1 | $replacements['{'.$key.'}'] = '['.gettype($val).']'; |
|
36 | } |
||
37 | 12 | } |
|
38 | |||
39 | 12 | return $replacements; |
|
40 | } |
||
41 | } |
||
42 |