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
9 declare(strict_types=1);
11 namespace Laminas\HttpHandlerRunner\Exception;
13 use InvalidArgumentException;
14 use Laminas\HttpHandlerRunner\Emitter;
16 use function get_class;
18 use function is_object;
21 class InvalidEmitterException extends InvalidArgumentException implements ExceptionInterface
24 * @param mixed $emitter Invalid emitter type
26 public static function forEmitter($emitter) : self
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)