for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Skalpa\Silex\Symfony\Routing;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\RequestContext;
/**
* Generates URLs using other generators.
*/
class ChainUrlGenerator implements UrlGeneratorInterface
{
private $context;
private $generators;
* @param UrlGeneratorInterface[] ...$generators
public function __construct(UrlGeneratorInterface ...$generators)
$this->generators = $generators;
}
* {@inheritdoc}
public function setContext(RequestContext $context)
foreach ($this->generators as $generator) {
$generator->setContext($context);
setContext
$generator
array<integer,object<Sym...UrlGeneratorInterface>>
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.
$this->context = $context;
public function getContext()
return $this->context;
public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
/** @var RouteNotFoundException $notFound */
$notFound = null;
try {
return $generator->generate($name, $parameters, $referenceType);
generate
} catch (RouteNotFoundException $e) {
$notFound = $e;
throw $notFound;
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.