Completed
Branch dev (374206)
by James Ekow Abaka
06:04
created

MustacheEngineFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ntentan\honam\factories;
4
5
use ntentan\honam\template_engines\AbstractEngine;
6
use ntentan\honam\template_engines\mustache\MustacheLoader;
7
use ntentan\honam\template_engines\mustache\MustachePartialsLoader;
8
use ntentan\honam\template_engines\MustacheEngine;
9
10
11
class MustacheEngineFactory implements EngineFactoryInterface
12
{
13
    public function create() : AbstractEngine
14
    {
15
        $loaderMustache = new \Mustache_Engine([
16
            'loader' => new MustacheLoader(), 'partials_loader' => new MustachePartialsLoader()]
0 ignored issues
show
Bug introduced by
The call to MustachePartialsLoader::__construct() misses a required argument $mustache.

This check looks for function calls that miss required arguments.

Loading history...
17
        );
18
        $stringMustache = new \Mustache_Engine(['partials_loader' => new MustachePartialsLoader()]);
0 ignored issues
show
Bug introduced by
The call to MustachePartialsLoader::__construct() misses a required argument $mustache.

This check looks for function calls that miss required arguments.

Loading history...
19
        return new MustacheEngine($loaderMustache, $stringMustache);
20
    }
21
}
22