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

Commit 779d532

Browse files
michaelmoussamichalbundyra
authored andcommitted
Replace container-interop with PSR-11
1 parent 54f5a52 commit 779d532

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+100
-106
lines changed

benchmarks/BenchAsset/AbstractFactoryFoo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace ZendBench\ServiceManager\BenchAsset;
99

10-
use Interop\Container\ContainerInterface;
10+
use Psr\Container\ContainerInterface;
1111
use Zend\ServiceManager\Factory\AbstractFactoryInterface;
1212

1313
class AbstractFactoryFoo implements AbstractFactoryInterface

benchmarks/BenchAsset/FactoryFoo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace ZendBench\ServiceManager\BenchAsset;
99

10-
use Interop\Container\ContainerInterface;
10+
use Psr\Container\ContainerInterface;
1111
use Zend\ServiceManager\Factory\FactoryInterface;
1212

1313
class FactoryFoo implements FactoryInterface

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
},
2323
"require": {
2424
"php": "^7.1",
25-
"container-interop/container-interop": "^1.2",
2625
"psr/container": "^1.0",
2726
"zendframework/zend-stdlib": "^3.1"
2827
},
@@ -34,7 +33,6 @@
3433
"zendframework/zend-coding-standard": "~1.0.0"
3534
},
3635
"provide": {
37-
"container-interop/container-interop-implementation": "^1.2",
3836
"psr/container-implementation": "^1.0"
3937
},
4038
"suggest": {
@@ -55,6 +53,9 @@
5553
"config": {
5654
"sort-packages": true
5755
},
56+
"conflict": {
57+
"container-interop/container-interop": "<1.2.0"
58+
},
5859
"extra": {
5960
"branch-alias": {
6061
"dev-master": "3.3-dev",

composer.lock

Lines changed: 32 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/book/configuring-the-service-manager.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ $serviceManager = new ServiceManager([
6060
As said before, a factory can also be a callable, to create more complex objects:
6161

6262
```php
63-
use Interop\Container\ContainerInterface;
63+
use Psr\Container\ContainerInterface;
6464
use Zend\ServiceManager\Factory\InvokableFactory;
6565
use Zend\ServiceManager\ServiceManager;
6666
use stdClass;
@@ -267,7 +267,7 @@ For instance, if we'd want to automatically inject the dependency
267267
`EventManagerAwareInterface`, we could create the following initializer:
268268

269269
```php
270-
use Interop\Container\ContainerInterface;
270+
use Psr\Container\ContainerInterface;
271271
use stdClass;
272272
use Zend\ServiceManager\ServiceManager;
273273

@@ -303,7 +303,7 @@ class MyInitializer implements InitializerInterface
303303

304304
// When creating the service manager:
305305

306-
use Interop\Container\ContainerInterface;
306+
use Psr\Container\ContainerInterface;
307307
use stdClass;
308308
use Zend\ServiceManager\ServiceManager;
309309

docs/book/delegators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ intercept actions being performed on the delegate in an
1414
A delegator factory has the following signature:
1515

1616
```php
17-
use Interop\Container\ContainerInterface;
17+
use Psr\Container\ContainerInterface;
1818

1919
public function __invoke(
2020
ContainerInterface $container,
@@ -106,7 +106,7 @@ A simple delegator factory for the `buzzer` service can be implemented as
106106
following:
107107

108108
```php
109-
use Interop\Container\ContainerInterface;
109+
use Psr\Container\ContainerInterface;
110110
use Zend\ServiceManager\Factory\DelegatorFactoryInterface;
111111

112112
class BuzzerDelegatorFactory implements DelegatorFactoryInterface

docs/book/migration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ To update this for version 3 compatibility, you will add the methods
436436
them, and update the existing methods to proxy to the new methods:
437437

438438
```php
439-
use Interop\Container\ContainerInterface;
439+
use Psr\Container\ContainerInterface;
440440
use Zend\ServiceManager\AbstractFactoryInterface;
441441
use Zend\ServiceManager\ServiceLocatorInterface;
442442

@@ -474,7 +474,7 @@ the migration artifacts:
474474
From our example above, we would update the class to read as follows:
475475

476476
```php
477-
use Interop\Container\ContainerInterface;
477+
use Psr\Container\ContainerInterface;
478478
use Zend\ServiceManager\Factory\AbstractFactoryInterface; // <-- note the change!
479479

480480
class LenientAbstractFactory implements AbstractFactoryInterface
@@ -562,7 +562,7 @@ To prepare this for version 3, we'd implement the `__invoke()` signature from
562562
version 3, and modify `createDelegatorWithName()` to proxy to it:
563563

564564
```php
565-
use Interop\Container\ContainerInterface;
565+
use Psr\Container\ContainerInterface;
566566
use Zend\ServiceManager\DelegatorFactoryInterface;
567567
use Zend\ServiceManager\ServiceLocatorInterface;
568568

@@ -591,7 +591,7 @@ the migration artifacts:
591591
From our example above, we would update the class to read as follows:
592592

593593
```php
594-
use Interop\Container\ContainerInterface;
594+
use Psr\Container\ContainerInterface;
595595
use Zend\ServiceManager\Factory\DelegatorFactoryInterface; // <-- note the change!
596596

597597
class ObserverAttachmentDelegator implements DelegatorFactoryInterface
@@ -674,7 +674,7 @@ To prepare this for version 3, we'd implement the `__invoke()` signature from
674674
version 3, and modify `createService()` to proxy to it:
675675

676676
```php
677-
use Interop\Container\ContainerInterface;
677+
use Psr\Container\ContainerInterface;
678678
use Zend\ServiceManager\FactoryInterface;
679679
use Zend\ServiceManager\ServiceLocatorInterface;
680680

@@ -706,7 +706,7 @@ the migration artifacts:
706706
From our example above, we would update the class to read as follows:
707707

708708
```php
709-
use Interop\Container\ContainerInterface;
709+
use Psr\Container\ContainerInterface;
710710
use Zend\ServiceManager\Factory\FactoryInterface; // <-- note the change!
711711

712712
class FooFactory implements FactoryInterface
@@ -808,7 +808,7 @@ To prepare this for version 3, we'd implement the `__invoke()` signature from
808808
version 3, and modify `initialize()` to proxy to it:
809809

810810
```php
811-
use Interop\Container\ContainerInterface;
811+
use Psr\Container\ContainerInterface;
812812
use Zend\ServiceManager\InitializerInterface;
813813
use Zend\ServiceManager\ServiceLocatorInterface;
814814

@@ -839,7 +839,7 @@ the migration artifacts:
839839
From our example above, we would update the class to read as follows:
840840

841841
```php
842-
use Interop\Container\ContainerInterface;
842+
use Psr\Container\ContainerInterface;
843843
use Zend\ServiceManager\Initializer\InitializerInterface; // <-- note the change!
844844

845845
class FooInitializer implements InitializerInterface

src/AbstractFactory/ConfigAbstractFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class ConfigAbstractFactory implements AbstractFactoryInterface
2424
*
2525
* {@inheritdoc}
2626
*/
27-
public function canCreate(\Interop\Container\ContainerInterface $container, $requestedName)
27+
public function canCreate(\Psr\Container\ContainerInterface $container, $requestedName)
2828
{
2929
if (! $container->has('config') || ! array_key_exists(self::class, $container->get('config'))) {
3030
return false;
@@ -38,7 +38,7 @@ public function canCreate(\Interop\Container\ContainerInterface $container, $req
3838
/**
3939
* {@inheritDoc}
4040
*/
41-
public function __invoke(\Interop\Container\ContainerInterface $container, $requestedName, array $options = null)
41+
public function __invoke(\Psr\Container\ContainerInterface $container, $requestedName, array $options = null)
4242
{
4343
if (! $container->has('config')) {
4444
throw new ServiceNotCreatedException('Cannot find a config array in the container');

src/AbstractFactory/ReflectionBasedAbstractFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Zend\ServiceManager\AbstractFactory;
99

10-
use Interop\Container\ContainerInterface;
10+
use Psr\Container\ContainerInterface;
1111
use ReflectionClass;
1212
use ReflectionParameter;
1313
use Zend\ServiceManager\Exception\ServiceNotFoundException;

src/AbstractFactoryInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
*
1717
* - rename the method `canCreateServiceWithName()` to `canCreate()`, and:
1818
* - rename the `$serviceLocator` argument to `$container`, and change the
19-
* typehint to `Interop\Container\ContainerInterface`
19+
* typehint to `Psr\Container\ContainerInterface`
2020
* - merge the `$name` and `$requestedName` arguments
2121
* - rename the method `createServiceWithName()` to `__invoke()`, and:
2222
* - rename the `$serviceLocator` argument to `$container`, and change the
23-
* typehint to `Interop\Container\ContainerInterface`
23+
* typehint to `Psr\Container\ContainerInterface`
2424
* - merge the `$name` and `$requestedName` arguments
2525
* - add the optional `array $options = null` argument.
2626
* - create a `canCreateServiceWithName()` method as defined in this interface, and have it

0 commit comments

Comments
 (0)