Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 4 | private static function formatFieldURI($preference, $expression) |
|
32 | { |
||
33 | 4 | $formattedRestrictionType = []; |
|
34 | |||
35 | 4 | foreach ($expression as $key => $value) { |
|
36 | 4 | if ($value === false) { |
|
37 | 2 | $value = 'false'; |
|
38 | } |
||
39 | 4 | $formattedRestrictionType[] = array( |
|
40 | 4 | 'FieldURI' => array('FieldURI' => API\FieldURIManager::getFieldUriByName($key, $preference)), |
|
41 | 4 | 'FieldURIOrConstant' => array('Constant' => array('Value' => (string)$value)) |
|
42 | 4 | ); |
|
43 | } |
||
44 | |||
45 | 4 | return $formattedRestrictionType; |
|
46 | } |
||
48 |