| Conditions | 6 |
| Paths | 17 |
| Total Lines | 18 |
| Code Lines | 11 |
| 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 | if ($view->getType()) { |
||
|
|
|||
| 15 | $target->setType($view->getType()); |
||
| 16 | } |
||
| 17 | foreach ($view->getParameters() as $parameter => $value) { |
||
| 18 | $target->setParameter($parameter, $value); |
||
| 19 | } |
||
| 20 | foreach ($view->getIgnoredProperties() as $property) { |
||
| 21 | $target->addIgnoredProperty($property); |
||
| 22 | } |
||
| 23 | foreach ($view->getExistingProperties() as $property) { |
||
| 24 | $target->forgetIgnoredProperty($property); |
||
| 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: