Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4.0072 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | 1 | public function get_schema_properties(bool $metadata = false) : array |
|
36 | { |
||
37 | 1 | if ($metadata === true) { |
|
38 | 1 | $metadata = 0; |
|
39 | } |
||
40 | 1 | $properties = array_filter($this->midgard['field_order'], function($input) use ($metadata) { |
|
41 | 1 | if (strpos($input, 'metadata_') === $metadata) { |
|
42 | 1 | return $input; |
|
43 | } |
||
44 | 1 | }); |
|
45 | 1 | if ($metadata === false) { |
|
46 | 1 | $properties[] = 'metadata'; |
|
47 | } else { |
||
48 | 1 | $properties = array_map(function($input) { |
|
49 | return str_replace('metadata_', '', $input); |
||
50 | 1 | }, $properties); |
|
51 | } |
||
52 | 1 | return $properties; |
|
53 | } |
||
55 |