Passed
Push — refactor/backendModule-ValueOb... ( 355cec )
by Tomas Norre
07:44
created

CrawlAction   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 29
ccs 10
cts 14
cp 0.7143
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getCrawlActionLabel() 0 3 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
    /**
17
     * @var string
18
     */
19
    private $crawlActionLabel;
20
21 3
    public function __construct(string $crawlAction, string $crawlActionLabel)
22
    {
23 3
        Assert::that($crawlAction)
24 3
            ->inArray(['start', 'log', 'multiprocess']);
25
26 2
        $this->crawlAction = $crawlAction;
27 2
        $this->crawlActionLabel = $crawlActionLabel;
28 2
    }
29
30 1
    public function __toString(): string
31
    {
32 1
        return $this->crawlAction;
33
    }
34
35 1
    public function getCrawlActionLabel(): string
36
    {
37 1
        return $this->crawlActionLabel;
38
    }
39
40
}
41