LogicException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 13
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A commandIsNotAnObject() 0 3 1
A factoryMethodIsNotProvided() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace WriteModel;
5
6
class LogicException extends \LogicException
7
{
8 1
    public static function factoryMethodIsNotProvided(array $fields): self
9
    {
10 1
        return new self(sprintf(
11 1
            'You need to provide factory method for fields: [%s]',
12 1
            implode(',', $fields)
13
        ));
14
    }
15
16 1
    public static function commandIsNotAnObject(): self
17
    {
18 1
        return new self('Factory method should return an object');
19
    }
20
}
21