Passed
Push — refactor/backendModule-ValueOb... ( 9011ea...037899 )
by Tomas Norre
13:04
created

CrawlAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 77.78%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 18
ccs 7
cts 9
cp 0.7778
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __toString() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AOE\Crawler\Value;
6
7
use Assert\Assert;
8
9
final class CrawlAction
10
{
11
    /**
12
     * @var string
13
     */
14
    private $crawlAction;
15
16 3
    public function __construct(string $crawlAction)
17
    {
18 3
        Assert::that($crawlAction)
19 3
            ->inArray(['start', 'log', 'multiprocess']);
20
21 2
        $this->crawlAction = $crawlAction;
22 2
    }
23
24 1
    public function __toString(): string
25
    {
26 1
        return $this->crawlAction;
27
    }
28
}
29