Passed
Push — master ( 392556...a36e60 )
by PHPinnacle
06:42 queued 04:41
created

InvalidYield   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
1
<?php
2
/**
3
 * This file is part of PHPinnacle/Ensign.
4
 *
5
 * (c) PHPinnacle Team <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types = 1);
12
13
namespace PHPinnacle\Ensign\Exception;
14
15
use Amp\Promise;
16
17
final class InvalidYield extends EnsignException
18
{
19
    /**
20
     * @param mixed $value
21
     */
22 1
    public function __construct($value)
23
    {
24 1
        parent::__construct(\sprintf(
25 1
            "Unexpected yield; Expected an signal, callable, instance of %s or an array of such instances. Got: %s",
26 1
            Promise::class,
27 1
            \is_object($value) ? \get_class($value) : \gettype($value)
28
        ));
29 1
    }
30
}
31