Completed
Push — image-processors-refactoring ( dcd98f )
by Luis
05:57
created

InvalidProcessorChain::with()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 2
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 1
b 0
f 0
1
<?php
2
namespace PhUml\Processors;
3
4
use plProcessor;
5
use RuntimeException;
6
7
class InvalidProcessorChain extends RuntimeException
8
{
9 12
    public static function with(plProcessor $last, plProcessor $next)
10
    {
11 12
        return new InvalidProcessorChain(sprintf(
12 12
            'Two processors in the chain are incompatible. The first processor\'s output is "%s". The next Processor in the queue does only support the following input type: %s.',
13 12
            $last->getOutputType(),
14 12
            $next->getInputType()
15
        ));
16
    }
17
}
18