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

TeamNamesCriterion   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 23
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A toArray() 0 4 1
A checkCollisionWithCriteria() 0 4 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