Passed
Push — master ( 71cd79...3a5308 )
by Vincent
02:53 queued 20s
created

ContainsOnlyAllowedMembersConstraint::matches()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 4

Importance

Changes 0
Metric Value
cc 4
eloc 6
nc 4
nop 1
dl 0
loc 13
ccs 7
cts 7
cp 1
crap 4
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace VGirol\JsonApiAssert\Constraint;
5
6
use VGirol\JsonApiStructure\Constraint\ContainsOnlyAllowedMembers;
7
8
/**
9
 * A constraint class to assert that a json object contains only members from the provided list.
10
 */
11
class ContainsOnlyAllowedMembersConstraint extends AbstractConstraint
12
{
13
    /**
14
     * Class constructor.
15
     *
16
     * @param array<string> $members
17
     */
18 6
    public function __construct(array $members)
19
    {
20 6
        $this->setConstraint(new ContainsOnlyAllowedMembers($members));
21 6
    }
22
}
23