This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
18
{
19
protected $templating;
20
protected $template;
21
22
3
public function __construct(EngineInterface $templating, $template = 'index.html.twig')
23
{
24
3
$this->templating = $templating;
25
3
$this->template = $template;
26
3
}
27
28
2
public function __invoke(...$arguments) // PHP 5.6+
29
{
30
// Variadic $arguments apparently not supported when empty by Symfony 3.3.6 ArgumentResolver
31
// and viewed as a regular array by knplabs/rad-resource-resolver v2.1
32
33
2
return new Response($this->templating->render($this->template, $arguments));
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.