Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Replace container-interop with PSR-11 container interface #52

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions doc/book/lazy-listeners/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
5 changes: 3 additions & 2 deletions doc/book/lazy-listeners/lazy-event-listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions doc/book/lazy-listeners/lazy-listener-aggregate.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions doc/book/lazy-listeners/lazy-listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion src/LazyEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Zend\EventManager;

use Interop\Container\ContainerInterface;
use Psr\Container\ContainerInterface;

/**
* Lazy listener instance for use with LazyListenerAggregate.
Expand Down
2 changes: 1 addition & 1 deletion src/LazyListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Zend\EventManager;

use Interop\Container\ContainerInterface;
use Psr\Container\ContainerInterface;

/**
* Lazy listener instance.
Expand Down
2 changes: 1 addition & 1 deletion src/LazyListenerAggregate.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Zend\EventManager;

use Interop\Container\ContainerInterface;
use Psr\Container\ContainerInterface;

/**
* Aggregate listener for attaching lazy listeners.
Expand Down
2 changes: 1 addition & 1 deletion test/LazyEventListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/LazyListenerAggregateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/LazyListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/TestAsset/BuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down