ExamplesKeyword   A
last analyzed

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 7
c 1
b 0
f 0
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JsonSchema\Keyword;
6
7
use Webmozart\Assert\Assert;
8
9
class ExamplesKeyword extends AbstractKeyword
10
{
11
    const NAME = 'examples';
12
13
    /**
14
     * @param array<mixed[]|bool|float|int|object|string|null>|null $examples
15
     */
16 8
    public function __construct(?array $examples)
17
    {
18 8
        if (null === $examples) {
0 ignored issues
show
introduced by
The condition null === $examples is always false.
Loading history...
19 8
            parent::__construct(static::NAME, null);
20
21 8
            return;
22
        }
23
24 8
        Assert::isNonEmptyList($examples);
25
26 8
        parent::__construct(static::NAME, $examples);
27 8
    }
28
}
29