ContainsKeyword   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
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 13
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JsonSchema\Keyword;
6
7
use JsonSchema\Schema\SchemaInterface;
8
9
class ContainsKeyword extends AbstractKeyword
10
{
11
    const NAME = 'contains';
12
13 1
    public function __construct(?SchemaInterface $contains)
14
    {
15 1
        if (null === $contains) {
16 1
            parent::__construct(static::NAME, null);
17
18 1
            return;
19
        }
20
21 1
        parent::__construct(static::NAME, $contains->toJsonSchema());
22 1
    }
23
}
24