You are here

private function DumperPrefixCollectionTest::collectionToString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php \Symfony\Component\Routing\Tests\Matcher\Dumper\DumperPrefixCollectionTest::collectionToString()
2 calls to DumperPrefixCollectionTest::collectionToString()
DumperPrefixCollectionTest::testAddPrefixRoute in vendor/symfony/routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php
DumperPrefixCollectionTest::testMergeSlashNodes in vendor/symfony/routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php

File

vendor/symfony/routing/Tests/Matcher/Dumper/DumperPrefixCollectionTest.php, line 109

Class

DumperPrefixCollectionTest

Namespace

Symfony\Component\Routing\Tests\Matcher\Dumper

Code

private function collectionToString(DumperCollection $collection, $prefix) {
  $string = '';
  foreach ($collection as $route) {
    if ($route instanceof DumperCollection) {
      $string .= sprintf("%s|-coll %s\n", $prefix, $route
        ->getPrefix());
      $string .= $this
        ->collectionToString($route, $prefix . '| ');
    }
    else {
      $string .= sprintf("%s|-route %s %s\n", $prefix, $route
        ->getName(), $route
        ->getRoute()
        ->getPath());
    }
  }
  return $string;
}