Conditions | 7 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function shouldSkipPropertyWithValue(PropertyMetadata $property, Context $context, $value): bool |
||
16 | { |
||
17 | if ( |
||
18 | $property->skipWhenEmpty |
||
19 | || ( |
||
20 | $context->hasAttribute(Context::ATTR_SKIP_WHEN_EMPTY) |
||
21 | && $context->getAttribute(Context::ATTR_SKIP_WHEN_EMPTY) |
||
22 | ) |
||
23 | ) { |
||
24 | if ($value instanceof \ArrayObject || \is_array($value) && 0 === count($value)) { |
||
25 | return true; |
||
26 | } |
||
27 | |||
28 | // This would be used for T object types, later, in the visitor->visitProperty |
||
29 | $property->skipWhenEmpty = true; |
||
30 | } |
||
31 | |||
32 | return false; |
||
33 | } |
||
35 |