HandlerNotFoundException::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 2
nop 1
dl 0
loc 10
ccs 7
cts 7
cp 1
crap 2
rs 10
c 0
b 0
f 0
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