Passed
Pull Request — master (#806)
by Maxim
19:17
created

Raw   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
c 0
b 0
f 0
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getIterator() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiral\Stempler\Node;
6
7
use Spiral\Stempler\Node\Traits\ContextTrait;
8
use Spiral\Stempler\Parser\Context;
9
10
/**
11
 * Plain text or comment. Might contain inclusion of other syntaxes within it.
12
 *
13
 * @implements NodeInterface<Raw>
14
 */
15
final class Raw implements NodeInterface
16
{
17
    use ContextTrait;
18
19 111
    public function __construct(
20
        public string|int|float $content,
21
        Context $context = null
22
    ) {
23 111
        $this->context = $context;
24
    }
25
26 84
    public function getIterator(): \Generator
27
    {
28 84
        yield from [];
29
    }
30
}
31