ElseKeyword   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
namespace JsonSchema\Keyword;
4
5
use JsonSchema\Schema\SchemaInterface;
6
7
class ElseKeyword extends AbstractKeyword
8
{
9
    const NAME = 'else';
10
11 8
    public function __construct(?SchemaInterface $else)
12
    {
13 8
        if (null === $else) {
14 8
            parent::__construct(static::NAME, null);
15
16 8
            return;
17
        }
18
19 8
        parent::__construct(static::NAME, $else->toJsonSchema());
20 8
    }
21
}
22