CollectorException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A duplicatedKey() 0 5 1
1
<?php
2
declare(strict_types=1);
3
4
namespace JsonDecodeStream\Exception;
5
6
use JsonDecodeStream\Event;
7
8
class CollectorException extends JsonDecodeStreamException
9
{
10
    const CODE_DUPLICATE_KEY = 1;
11
12
    public static function duplicatedKey(string $key, Event $event)
13
    {
14
        return new static(
15
            "Key `$key` is duplicated in {$event->getPath()} at {$event->getLineNumber()}:{$event->getCharNumber()}",
16
            static::CODE_DUPLICATE_KEY
17
        );
18
    }
19
}
20