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