InvalidYield::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 1
nop 1
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
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