Skip   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 7
c 1
b 0
f 0
dl 0
loc 27
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A unparsed() 0 3 1
A use() 0 3 1
A ok() 0 3 1
A __construct() 0 1 1
A upTo() 0 3 1
A data() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\Parser\Results;
4
5
use Stratadox\Parser\Result;
6
7
/**
8
 * Skip Result
9
 *
10
 * Signifies the result should not be used.
11
 */
12
final class Skip implements Result
13
{
14
    public function __construct(private string $unparsed) {}
15
16
    public static function upTo(string $unparsed): Result
17
    {
18
        return new self($unparsed);
19
    }
20
21
    public function data(): mixed
22
    {
23
        return null;
24
    }
25
26
    public function unparsed(): string
27
    {
28
        return $this->unparsed;
29
    }
30
31
    public function ok(): bool
32
    {
33
        return true;
34
    }
35
36
    public function use(): bool
37
    {
38
        return false;
39
    }
40
}
41