Completed
Push — dev ( c5a23f...f84598 )
by James Ekow Abaka
09:41
created

PhpEngineFactory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
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\Honam;
10
use ntentan\honam\TemplateFileResolver;
11
use ntentan\honam\TemplateRenderer;
12
13
class PhpEngineFactory implements EngineFactoryInterface
14
{
15
    public function __construct(TemplateFileResolver $templateFileResolver)
16
    {
17
        $templateFileResolver->appendToPathHierarchy(__DIR__ . "/../../templates/forms");
18
    }
19
20
    public function create(TemplateRenderer $templateRenderer): AbstractEngine
21
    {
22
        $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...
23
        $janitor = new Janitor();
24
        return new PhpEngine($helpersLoader, $janitor);
25
    }
26
}
27