BadTargetInterfaceException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 2
c 1
b 0
f 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * BadTargetInterfaceException
5
 *
6
 * @package php-deferred-callchain
7
 * @author  Jean Claveau
8
 */
9
namespace JClaveau\Async\Exceptions;
10
11
use JClaveau\Async\DeferredCallChain;
12
use LogicException;
13
/**
14
 * Thrown when applying a deferred call chain on a target which doesn't
15
 * implement the expected interface.
16
 */
17
class BadTargetInterfaceException extends LogicException
18
{
19
    /**
20
     * Constructor.
21
     * 
22
     * @param DeferredCallChain $callchain
23
     * @param mixed             $expected_target The expected interface
24
     * @param mixed             $target
25
     */
26
    public function __construct(DeferredCallChain $callchain, $expected_target, $target)
27
    {
28
        $this->message = "You are trying to define a target of class " . get_class($target) . " for the {$callchain} allowing only targets implementing " . $expected_target;
29
    }
30
}