Passed
Push — master ( f1d673...c425eb )
by mcfog
01:06
created

TwigViewBuilderTrait::twig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Lit\View\Twig;
6
7
trait TwigViewBuilderTrait
8
{
9
    /**
10
     * @var TwigViewFactory
11
     */
12
    protected $twigViewFactory;
13
14
    public function injectTwigViewFactory(TwigViewFactory $twigViewFactory)
15
    {
16
        $this->twigViewFactory = $twigViewFactory;
17
        return $this;
18
    }
19
20
    protected function twig(string $name)
21
    {
22
        return $this->attachView($this->twigViewFactory->load($name));
0 ignored issues
show
Bug introduced by
It seems like attachView() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

22
        return $this->/** @scrutinizer ignore-call */ attachView($this->twigViewFactory->load($name));
Loading history...
23
    }
24
}
25