Passed
Push — refactor/backendModule-ValueOb... ( 355cec...0f77d0 )
by Tomas Norre
13:40
created

CrawlAction::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.008

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 2
b 0
f 0
nc 1
nop 1
dl 0
loc 6
ccs 4
cts 5
cp 0.8
crap 1.008
rs 10
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
    /**
17
     * @var string
18
     */
19
    private $crawlActionLabel;
20
21 3
    public function __construct(string $crawlAction)
22
    {
23 3
        Assert::that($crawlAction)
24 3
            ->inArray(['start', 'log', 'multiprocess']);
25
26 2
        $this->crawlAction = $crawlAction;
27 2
    }
28
29 1
    public function __toString(): string
30
    {
31 1
        return $this->crawlAction;
32
    }
33
34 1
    public function getCrawlActionLabel(): string
35
    {
36 1
        return $this->crawlActionLabel;
37
    }
38
39
}
40