Completed
Push — dev ( fce939...48451b )
by James Ekow Abaka
08:05
created

SmartyEngineFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
namespace ntentan\honam\factories;
3
4
use ntentan\honam\factories\EngineFactoryInterface;
5
use ntentan\honam\engines\AbstractEngine;
6
use ntentan\honam\engines\PhpEngine;
7
use ntentan\honam\engines\php\HelperFactory;
8
use ntentan\honam\engines\php\Janitor;
9
use ntentan\honam\TemplateFileResolver;
10
use ntentan\honam\TemplateRenderer;
11
12
class SmartyEngineFactory implements EngineFactoryInterface
13
{
14
    public function create(TemplateRenderer $templateRenderer): AbstractEngine
15
    {
16
        $helpersLoader = new HelperFactory($templateRenderer);
0 ignored issues
show
Unused Code introduced by
The call to HelperFactory::__construct() has too many arguments starting with $templateRenderer.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
17
        $janitor = new Janitor();
18
        return new PhpEngine($helpersLoader, $janitor);
19
    }
20
}
21