Passed
Push — master ( b73665...44e90f )
by Peter
32s
created

TeamNamesCriterion::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace PtrTn\Battlerite\Query\Matches;
4
5
use PtrTn\Battlerite\Query\CriterionInterface;
6
use Webmozart\Assert\Assert;
7
8
class TeamNamesCriterion implements CriterionInterface
9
{
10
    /**
11
     * @var array
12
     */
13
    private $teamNames;
14
15 1
    public function __construct(array $teamNames)
16
    {
17 1
        Assert::allString($teamNames, 'Specified team names should be an array of strings');
18 1
        $this->teamNames = $teamNames;
19 1
    }
20
21 1
    public function toArray(): array
22
    {
23 1
        return ['filter[teamNames]' => implode(',', $this->teamNames)];
24
    }
25
26 1
    public function checkCollisionWithCriteria(array $critera): void
27
    {
28 1
        return;
29
    }
30
}
31