mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-12 10:01:27 +08:00
Removed use of Interop container
This commit is contained in:
@@ -3,19 +3,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\EventDispatcher\Async;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Swoole\Http\Server as HttpServer;
|
||||
use Zend\ServiceManager\Factory\DelegatorFactoryInterface;
|
||||
|
||||
class TaskRunnerDelegator implements DelegatorFactoryInterface
|
||||
class TaskRunnerDelegator
|
||||
{
|
||||
public function __invoke(
|
||||
ContainerInterface $container,
|
||||
$name,
|
||||
callable $callback,
|
||||
?array $options = null
|
||||
): HttpServer {
|
||||
public function __invoke(ContainerInterface $container, $name, callable $callback): HttpServer
|
||||
{
|
||||
/** @var HttpServer $server */
|
||||
$server = $callback();
|
||||
$logger = $container->get(LoggerInterface::class);
|
||||
|
||||
|
||||
@@ -3,13 +3,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\EventDispatcher\Async;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Zend\ServiceManager\Factory\FactoryInterface;
|
||||
|
||||
class TaskRunnerFactory implements FactoryInterface
|
||||
class TaskRunnerFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null): TaskRunner
|
||||
public function __invoke(ContainerInterface $container): TaskRunner
|
||||
{
|
||||
$logger = $container->get(LoggerInterface::class);
|
||||
return new TaskRunner($logger, $container);
|
||||
|
||||
@@ -3,17 +3,16 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\EventDispatcher\Listener;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Phly\EventDispatcher\ListenerProvider\AttachableListenerProvider;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Swoole\Http\Server as HttpServer;
|
||||
use Zend\ServiceManager\Factory\FactoryInterface;
|
||||
|
||||
use function Phly\EventDispatcher\lazyListener;
|
||||
use function Shlinkio\Shlink\EventDispatcher\asyncListener;
|
||||
|
||||
class ListenerProviderFactory implements FactoryInterface
|
||||
class ListenerProviderFactory
|
||||
{
|
||||
public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null)
|
||||
public function __invoke(ContainerInterface $container)
|
||||
{
|
||||
$config = $container->has('config') ? $container->get('config') : [];
|
||||
$events = $config['events'] ?? [];
|
||||
|
||||
@@ -3,8 +3,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioTest\Shlink\EventDispatcher\Async;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Shlinkio\Shlink\EventDispatcher\Async\TaskRunner;
|
||||
use Shlinkio\Shlink\EventDispatcher\Async\TaskRunnerDelegator;
|
||||
|
||||
@@ -3,8 +3,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioTest\Shlink\EventDispatcher\Async;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use ReflectionObject;
|
||||
use Shlinkio\Shlink\EventDispatcher\Async\TaskRunner;
|
||||
|
||||
@@ -3,9 +3,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace ShlinkioTest\Shlink\EventDispatcher\Listener;
|
||||
|
||||
use Interop\Container\ContainerInterface;
|
||||
use Phly\EventDispatcher\ListenerProvider\AttachableListenerProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use ReflectionObject;
|
||||
use Shlinkio\Shlink\EventDispatcher\Listener\ListenerProviderFactory;
|
||||
use Swoole\Http\Server as HttpServer;
|
||||
|
||||
Reference in New Issue
Block a user