Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
UnknownOwnerException | n/a |
0 / 0 |
n/a |
0 / 0 |
3 | n/a |
0 / 0 |
|||
__construct | n/a |
0 / 0 |
n/a |
0 / 0 |
3 |
1 | <?php |
2 | |
3 | namespace TonyBogdanov\Memoize\Exceptions; |
4 | |
5 | use RuntimeException; |
6 | |
7 | /** |
8 | * Class UnknownOwnerException |
9 | * |
10 | * @package TonyBogdanov\Memoize\Exceptions |
11 | * |
12 | * @codeCoverageIgnore |
13 | */ |
14 | class UnknownOwnerException extends RuntimeException { |
15 | |
16 | /** |
17 | * UnknownOwnerException constructor. |
18 | * |
19 | * @param $owner |
20 | */ |
21 | public function __construct( $owner ) { |
22 | if ( is_object( $owner ) ) { |
23 | $owner = get_class( $owner ); |
24 | } else if ( is_array( $owner ) ) { |
25 | $owner = '(array) ...'; |
26 | } else { |
27 | $owner = var_export( $owner, true ); |
28 | } |
29 | |
30 | parent::__construct( sprintf( 'Unknown owner reference: %1$s.', $owner ) ); |
31 | } |
32 | |
33 | } |