| Conditions | 5 |
| Paths | 9 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public static function merge(ViewInterface... $views): View |
||
| 11 | { |
||
| 12 | $target = new View(); |
||
| 13 | foreach ($views as $view) { |
||
| 14 | $target |
||
| 15 | ->setChildViews($view->getChildViews()) |
||
| 16 | ->setAppendChildViews($view->shouldAppendChildViews()); |
||
| 17 | if ($view->getType()) { |
||
|
|
|||
| 18 | $target->setType($view->getType()); |
||
| 19 | } |
||
| 20 | if ($view->getTargetEntity()) { |
||
| 21 | $target->setTargetEntity($view->getTargetEntity()); |
||
| 22 | } |
||
| 23 | foreach ($view->getParameters() as $parameter => $value) { |
||
| 24 | $target->setParameter($parameter, $value); |
||
| 25 | } |
||
| 26 | } |
||
| 27 | return $target; |
||
| 28 | } |
||
| 40 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: