mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
35 lines
1.2 KiB
PHP
35 lines
1.2 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink\Common\Factory;
|
|
|
|
use Interop\Container\ContainerInterface;
|
|
use Interop\Container\Exception\ContainerException;
|
|
use Zend\Diactoros\Response\EmptyResponse;
|
|
use Zend\Expressive\Router\Middleware\ImplicitOptionsMiddleware;
|
|
use Zend\ServiceManager\Exception\ServiceNotCreatedException;
|
|
use Zend\ServiceManager\Exception\ServiceNotFoundException;
|
|
use Zend\ServiceManager\Factory\FactoryInterface;
|
|
|
|
class EmptyResponseImplicitOptionsMiddlewareFactory implements FactoryInterface
|
|
{
|
|
/**
|
|
* Create an object
|
|
*
|
|
* @param ContainerInterface $container
|
|
* @param string $requestedName
|
|
* @param null|array $options
|
|
* @return object
|
|
* @throws ServiceNotFoundException if unable to resolve the service.
|
|
* @throws ServiceNotCreatedException if an exception is raised when
|
|
* creating a service.
|
|
* @throws ContainerException if any other error occurs
|
|
*/
|
|
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
|
|
{
|
|
return new ImplicitOptionsMiddleware(function () {
|
|
return new EmptyResponse();
|
|
});
|
|
}
|
|
}
|