HandlerNotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 12
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
3
namespace Cypress\PatchManager\Exception;
4
5
use PhpCollection\Sequence;
6
7
class HandlerNotFoundException extends PatchManagerException
8
{
9 2
    public function __construct(Sequence $unmatchedOperations)
10
    {
11 2
        $message = 'No handler was found ';
12 2
        if ($unmatchedOperations->count() > 1) {
13 1
            $message .= 'for the operators \''.implode(', ', $unmatchedOperations->all()).'\'. ';
14
        } else {
15 1
            $message .= 'for the operator \''.$unmatchedOperations->first()->get().'\'. ';
16
        }
17 2
        $message .= 'This is not allowed with strict_mode enabled';
18 2
        parent::__construct($message);
19
    }
20
}
21