Passed
Push — master ( 72c793...7f699f )
by Kirill
03:22
created

NativeEngine::reset()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 2
rs 10
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Views\Engine\Native;
13
14
use Psr\Container\ContainerInterface;
15
use Spiral\Views\ContextInterface;
16
use Spiral\Views\Engine\AbstractEngine;
17
use Spiral\Views\ViewInterface;
18
19
final class NativeEngine extends AbstractEngine
20
{
21
    protected const EXTENSION = 'php';
22
23
    /** @var ContainerInterface */
24
    private $container;
25
26
    /**
27
     * NativeEngine constructor.
28
     *
29
     * @param ContainerInterface $container
30
     * @param string             $extension
31
     */
32
    public function __construct(ContainerInterface $container, string $extension = self::EXTENSION)
33
    {
34
        $this->container = $container;
35
        $this->extension = $extension;
36
    }
37
38
    /**
39
     * @inheritdoc
40
     */
41
    public function compile(string $path, ContextInterface $context): void
42
    {
43
        // doing nothing, native views can not be compiled
44
    }
45
46
    /**
47
     * @inheritdoc
48
     */
49
    public function reset(string $path, ContextInterface $context): void
50
    {
51
        // doing nothing, native views can not be compiled
52
    }
53
54
    /**
55
     * @inheritdoc
56
     */
57
    public function get(string $path, ContextInterface $context): ViewInterface
58
    {
59
        return new NativeView($this->getLoader()->load($path), $this->container, $context);
60
    }
61
}
62