public function DumperPrefixCollection::mergeSlashNodes in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/routing/Matcher/Dumper/DumperPrefixCollection.php \Symfony\Component\Routing\Matcher\Dumper\DumperPrefixCollection::mergeSlashNodes()
Merges nodes whose prefix ends with a slash.
Children of a node whose prefix ends with a slash are moved to the parent node
File
- vendor/
symfony/ routing/ Matcher/ Dumper/ DumperPrefixCollection.php, line 88
Class
- DumperPrefixCollection
- Prefix tree of routes preserving routes order.
Namespace
Symfony\Component\Routing\Matcher\DumperCode
public function mergeSlashNodes() {
$children = array();
foreach ($this as $child) {
if ($child instanceof self) {
$child
->mergeSlashNodes();
if ('/' === substr($child->prefix, -1)) {
$children = array_merge($children, $child
->all());
}
else {
$children[] = $child;
}
}
else {
$children[] = $child;
}
}
$this
->setAll($children);
}