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

MustacheEngineFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
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