Dumps a set of routes to a PHP class.
Available options:
@api
array $options An array of options:
string A PHP class representing the generator class
Overrides GeneratorDumperInterface::dump
public function dump(array $options = array()) {
$options = array_merge(array(
'class' => 'ProjectUrlGenerator',
'base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator',
), $options);
return <<<EOF
<?php
use Symfony\\Component\\Routing\\RequestContext;
use Symfony\\Component\\Routing\\Exception\\RouteNotFoundException;
use Symfony\\Component\\HttpKernel\\Log\\LoggerInterface;
/**
* {<span class="php-variable">$options</span>[<span class="php-string">'class'</span>]}
*
* This class has been auto-generated
* by the Symfony Routing Component.
*/
class {<span class="php-variable">$options</span>[<span class="php-string">'class'</span>]} extends {<span class="php-variable">$options</span>[<span class="php-string">'base_class'</span>]}
{
static private \$declaredRoutes = {<span class="php-variable">$this</span>
-><span class="php-function-or-constant function member-of-self">generateDeclaredRoutes</span>()};
/**
* Constructor.
*/
public function __construct(RequestContext \$context, LoggerInterface \$logger = null)
{
\$this->context = \$context;
\$this->logger = \$logger;
}
{<span class="php-variable">$this</span>
-><span class="php-function-or-constant function member-of-self">generateGenerateMethod</span>()}
}
EOF;
}