cbcd3a3fdfe23605833815c6ae0407ee0546e5f0
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 /**
4 * @see https://github.com/laminas/laminas-httphandlerrunner for the canonical source repository
5 * @copyright https://github.com/laminas/laminas-httphandlerrunner/blob/master/COPYRIGHT.md
6 * @license https://github.com/laminas/laminas-httphandlerrunner/blob/master/LICENSE.md New BSD License
7 */
8
9 declare(strict_types=1);
10
11 namespace Laminas\HttpHandlerRunner\Exception;
12
13 use InvalidArgumentException;
14 use Laminas\HttpHandlerRunner\Emitter;
15
16 use function get_class;
17 use function gettype;
18 use function is_object;
19 use function sprintf;
20
21 class InvalidEmitterException extends InvalidArgumentException implements ExceptionInterface
22 {
23 /**
24 * @param mixed $emitter Invalid emitter type
25 */
26 public static function forEmitter($emitter) : self
27 {
28 return new self(sprintf(
29 '%s can only compose %s implementations; received %s',
30 Emitter\EmitterStack::class,
31 Emitter\EmitterInterface::class,
32 is_object($emitter) ? get_class($emitter) : gettype($emitter)
33 ));
34 }
35 }