BadTargetClassException   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
 * BadTargetClassException
4
 *
5
 * @package php-deferred-callchain
6
 * @author  Jean Claveau
7
 */
8
namespace JClaveau\Async\Exceptions;
9
use       JClaveau\Async\DeferredCallChain;
10
use       LogicException;
11
12
/**
13
 * Thrown when applying a deferred call chain on a target which is not
14
 * an instance of the expected class.
15
 */
16
class BadTargetClassException extends LogicException
17
{
18
    /**
19
     * Constructor.
20
     * 
21
     * @param DeferredCallChain $callchain
22
     * @param mixed             $expected_target The expected class
23
     * @param mixed             $target
24
     */
25
    public function __construct(DeferredCallChain $callchain, $expected_target, $target)
26
    {
27
        $this->message = "You are trying to define a target of class ".get_class($target)." for the $callchain allowing only targets of class ".$expected_target;
28
    }
29
    
30
    /**/
31
}
32