Conditions | 8 |
Paths | 48 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 8 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | protected function configureNormalizerFormatter(NormalizerFormatter $formatter, array $options): void |
||
16 | { |
||
17 | if (isset($options['date_format'])) { |
||
18 | $formatter->setDateFormat($options['date_format']); |
||
19 | } |
||
20 | |||
21 | if (isset($options['max_normalize_depth'])) { |
||
22 | 11 | $formatter->setMaxNormalizeDepth((int)$options['max_normalize_depth']); |
|
23 | } |
||
24 | 11 | ||
25 | 3 | if (isset($options['max_normalize_item_count'])) { |
|
26 | $formatter->setMaxNormalizeItemCount((int)$options['max_normalize_item_count']); |
||
27 | } |
||
28 | 11 | ||
29 | 2 | if (isset($options['json_pretty_print'])) { |
|
30 | $formatter->setJsonPrettyPrint((bool)$options['json_pretty_print']); |
||
31 | } |
||
32 | 11 | ||
33 | 1 | if (!empty($options['json_encode_options']) && is_array($options['json_encode_options'])) { |
|
34 | foreach ($options['json_encode_options'] as $jsonEncodeOption) { |
||
35 | $formatter->addJsonEncodeOption((int)$jsonEncodeOption); |
||
36 | 11 | } |
|
40 |