for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Shlinkio\Shlink\Common\Http\Exception;
use Shlinkio\Shlink\Common\Exception\InvalidArgumentException;
use function get_class;
use function getType;
use function is_object;
use function sprintf;
class InvalidHttpMiddlewareException extends InvalidArgumentException
{
/**
* @param mixed $middleware
*/
public static function fromMiddleware($middleware): self
return new self(sprintf(
'Provided middleware does not have a valid type. Expected callable, %s provided',
is_object($middleware) ? get_class($middleware) : getType($middleware),
));
}