Passed
Push — refactor/queueFilterObject ( 670f70 )
by Tomas Norre
06:59
created

QueueFilter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 18
ccs 7
cts 7
cp 1
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
/*
8
 * (c) 2020 AOE GmbH <[email protected]>
9
 *
10
 * This file is part of the TYPO3 Crawler Extension.
11
 *
12
 * It is free software; you can redistribute it and/or modify it under
13
 * the terms of the GNU General Public License, either version 2
14
 * of the License, or any later version.
15
 *
16
 * For the full copyright and license information, please read the
17
 * LICENSE.txt file that was distributed with this source code.
18
 *
19
 * The TYPO3 project - inspiring people to share!
20
 */
21
22
use Assert\Assert;
23
24
class QueueFilter
25
{
26
    /**
27
     * @var string
28
     */
29
    private $queueFilter;
30
31 3
    public function __construct(string $queueFilter = 'all')
32
    {
33 3
        Assert::that($queueFilter)
34 3
            ->inArray(['all', 'pending', 'finished']);
35
36 2
        $this->queueFilter = $queueFilter;
37 2
    }
38
39 9
    public function __toString()
40
    {
41 9
        return $this->queueFilter;
42
    }
43
}
44