Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public static function combine(EntityInterface $parent, EntityInterface $child): EntityInterface |
||
23 | { |
||
24 | $result = (new Entity($child->getName())) |
||
25 | ->setRootLevelDocument($child->isRootLevelDocument()) |
||
26 | // TODO: proper indexing merging scheme |
||
27 | ->setIndexing($child->getIndexing()) |
||
28 | ->setMapping(Combiner::combine($parent->getMapping(), $child->getMapping())); |
||
29 | if ($child->getParentName()) { |
||
|
|||
30 | $result->setParentName($child->getParentName()); |
||
31 | } |
||
32 | return $result; |
||
33 | } |
||
35 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: