diff --git a/composer.json b/composer.json index 3b768a7..18b6376 100644 --- a/composer.json +++ b/composer.json @@ -37,14 +37,16 @@ "require-dev": { "phpunit/PHPUnit": "^6.0.7 || ^5.7.14", "phpbench/phpbench": "^0.13", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0", - "container-interop/container-interop": "^1.1.0", - "zendframework/zend-coding-standard": "~1.0.0" + "psr/container": "^1.0", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" }, "suggest": { - "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" }, + "conflict": { + "container-interop/container-interop": "<1.2.0" + }, "scripts": { "check": [ "@cs-check", diff --git a/doc/book/lazy-listeners/intro.md b/doc/book/lazy-listeners/intro.md index fa9a08b..0ae2b6b 100644 --- a/doc/book/lazy-listeners/intro.md +++ b/doc/book/lazy-listeners/intro.md @@ -18,8 +18,8 @@ The feature consists of three classes: ## Preparation In order to use the lazy listeners feature, you will need to install -container-interop, if you haven't already: +`psr/container`, if you haven't already: ```bash -$ composer require container-interop/container-interop +$ composer require psr/container ``` diff --git a/doc/book/lazy-listeners/lazy-event-listener.md b/doc/book/lazy-listeners/lazy-event-listener.md index 6297be2..6af87e4 100644 --- a/doc/book/lazy-listeners/lazy-event-listener.md +++ b/doc/book/lazy-listeners/lazy-event-listener.md @@ -23,8 +23,9 @@ As an example, let's assume: - we want to attach it to the event `dispatch`, - at priority 100. -Additionally, we'll assume that we have a container-interop instance in the -variable `$container` and an event manager in the variable `$events`. +Additionally, we'll assume that we have a `Psr\Container\ContainerInterface` +instance in the variable `$container` and an event manager in the variable +`$events`. You could create the lazy event listener as follows: diff --git a/doc/book/lazy-listeners/lazy-listener-aggregate.md b/doc/book/lazy-listeners/lazy-listener-aggregate.md index 46594f2..ffd10c8 100644 --- a/doc/book/lazy-listeners/lazy-listener-aggregate.md +++ b/doc/book/lazy-listeners/lazy-listener-aggregate.md @@ -7,8 +7,8 @@ number of listeners as lazy listeners. Similar to a [LazyListener](lazy-listener.md) or [LazyEventListener](lazy-event-listener.md), the `LazyListenerAggregate` accepts -a definition (or, rather, set of definitions) a container-interop instance, and -optionall an `$env` array to its constructor. +a definition (or, rather, set of definitions) a `Psr\Container\ContainerInterface` +instance, and optionally an `$env` array to its constructor. Unlike either, however, the definition provided is an array of definitions to use to create `LazyEventListener` instances; you may also intersperse actual diff --git a/doc/book/lazy-listeners/lazy-listener.md b/doc/book/lazy-listeners/lazy-listener.md index 81339d8..710f506 100644 --- a/doc/book/lazy-listeners/lazy-listener.md +++ b/doc/book/lazy-listeners/lazy-listener.md @@ -10,7 +10,7 @@ To create a `LazyListener` instance, you must pass to its constructor: - a *definition* of the listener; this is an array defining: - a `listener` key, with the name of the listener service to pull from the container. - a `method` key, with the name of the method to invoke on the listener instance. -- a *container*; this is a [container-interop](https://github.com/container-interop/container-interop), +- a *container*; this is a [PSR-11 container](https://github.com/php-fig/container), such as provided by [zend-servicemanager](https://github.com/zendframework/zend-servicemanager), [Aura.Di](https://github.com/auraphp/Aura.Di), etc. @@ -24,8 +24,8 @@ As an example, let's assume: - We have a listener registered in our container with the service name `My\Application\Listener`. - The specific listener method is `onDispatch`. -- I have a container-interop instance in the variable `$container` and an event - manager in the variable `$events`. +- I have a `Psr\Container\ContainerInterface` instance in the variable `$container` + and an event manager in the variable `$events`. I might then create and attach my lazy listener as follows: diff --git a/src/LazyEventListener.php b/src/LazyEventListener.php index be5cd7c..ae6b230 100644 --- a/src/LazyEventListener.php +++ b/src/LazyEventListener.php @@ -9,7 +9,7 @@ namespace Zend\EventManager; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; /** * Lazy listener instance for use with LazyListenerAggregate. diff --git a/src/LazyListener.php b/src/LazyListener.php index b1e7d92..4d3e7ba 100644 --- a/src/LazyListener.php +++ b/src/LazyListener.php @@ -9,7 +9,7 @@ namespace Zend\EventManager; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; /** * Lazy listener instance. diff --git a/src/LazyListenerAggregate.php b/src/LazyListenerAggregate.php index 1462870..06346d8 100644 --- a/src/LazyListenerAggregate.php +++ b/src/LazyListenerAggregate.php @@ -9,7 +9,7 @@ namespace Zend\EventManager; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; /** * Aggregate listener for attaching lazy listeners. diff --git a/test/LazyEventListenerTest.php b/test/LazyEventListenerTest.php index d1806f9..8ab3a55 100644 --- a/test/LazyEventListenerTest.php +++ b/test/LazyEventListenerTest.php @@ -9,7 +9,7 @@ namespace ZendTest\EventManager; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use Zend\EventManager\EventInterface; use Zend\EventManager\Exception\InvalidArgumentException; use Zend\EventManager\LazyEventListener; diff --git a/test/LazyListenerAggregateTest.php b/test/LazyListenerAggregateTest.php index d0901f1..7139d9d 100644 --- a/test/LazyListenerAggregateTest.php +++ b/test/LazyListenerAggregateTest.php @@ -9,9 +9,9 @@ namespace ZendTest\EventManager; -use Interop\Container\ContainerInterface; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\TestCase as TestCase; use Prophecy\Argument; +use Psr\Container\ContainerInterface; use ReflectionProperty; use Zend\EventManager\EventInterface; use Zend\EventManager\EventManagerInterface; diff --git a/test/LazyListenerTest.php b/test/LazyListenerTest.php index ebdc77b..ac6ed7c 100644 --- a/test/LazyListenerTest.php +++ b/test/LazyListenerTest.php @@ -9,9 +9,9 @@ namespace ZendTest\EventManager; -use Interop\Container\ContainerInterface; -use PHPUnit\Framework\TestCase; +use PHPUnit\Framework\TestCase as TestCase; use Prophecy\Argument; +use Psr\Container\ContainerInterface; use stdClass; use Zend\EventManager\EventInterface; use Zend\EventManager\Exception\InvalidArgumentException; diff --git a/test/TestAsset/BuilderInterface.php b/test/TestAsset/BuilderInterface.php index 156f005..a302040 100644 --- a/test/TestAsset/BuilderInterface.php +++ b/test/TestAsset/BuilderInterface.php @@ -9,7 +9,7 @@ namespace ZendTest\EventManager\TestAsset; -use Interop\Container\ContainerInterface; +use Psr\Container\ContainerInterface; /** * Mimic the ServiceManager v3 ServiceLocatorInterface in order to test