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

Commit 0ea2a90

Browse files
committed
Merge branch 'feature/275' into develop
Forward port #275 - Drop changes as obsolete for 4.0
2 parents f98a895 + 4367dc0 commit 0ea2a90

File tree

3 files changed

+50
-26
lines changed

3 files changed

+50
-26
lines changed

CHANGELOG.md

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,30 @@ All notable changes to this project will be documented in this file, in reverse
3232
- [#230](https://github.com/zendframework/zend-servicemanager/pull/230) fixes a
3333
problem in detecting cyclic aliases, ensuring they are detected correctly.
3434

35+
## 3.4.0 - TBD
36+
37+
### Added
38+
39+
- [#275](https://github.com/zendframework/zend-servicemanager/pull/275) Enables
40+
plugin managers to accept as a creation context PSR Containers not implementing
41+
Interop interface
42+
43+
### Changed
44+
45+
- Nothing.
46+
47+
### Deprecated
48+
49+
- Nothing.
50+
51+
### Removed
52+
53+
- Nothing.
54+
55+
### Fixed
56+
57+
- Nothing.
58+
3559
## 3.3.2 - 2018-01-29
3660

3761
### Added
@@ -91,7 +115,7 @@ All notable changes to this project will be documented in this file, in reverse
91115
container-interop at a minimum version of 1.2.0, and adding a requirement on
92116
psr/container 1.0. `Zend\ServiceManager\ServiceLocatorInterface` now
93117
explicitly extends the `ContainerInterface` from both projects.
94-
118+
95119
Factory interfaces still typehint against the container-interop variant, as
96120
changing the typehint would break backwards compatibility. Users can
97121
duck-type most of these interfaces, however, by creating callables or
@@ -369,7 +393,7 @@ Documentation is now available at http://zend-servicemanager.rtfd.org
369393
(previously, it was the third).
370394

371395
Example:
372-
396+
373397
```php
374398
$sm = new \Zend\ServiceManager\ServiceManager([
375399
'factories' => [
@@ -378,7 +402,7 @@ Documentation is now available at http://zend-servicemanager.rtfd.org
378402
'MyClassC' => 'MyFactory' // This is equivalent as using ::class
379403
],
380404
]);
381-
405+
382406
$sm->get(MyClassA::class); // MyFactory will receive MyClassA::class as second parameter
383407
```
384408

@@ -397,7 +421,7 @@ Documentation is now available at http://zend-servicemanager.rtfd.org
397421
if ($instance instanceof \Zend\Validator\ValidatorInterface) {
398422
return;
399423
}
400-
424+
401425
throw new InvalidServiceException(sprintf(
402426
'Plugin manager "%s" expected an instance of type "%s", but "%s" was received',
403427
__CLASS__,
@@ -407,19 +431,19 @@ Documentation is now available at http://zend-servicemanager.rtfd.org
407431
}
408432
}
409433
```
410-
434+
411435
In version 3, this becomes:
412-
436+
413437
```php
414438
use Zend\ServiceManager\AbstractPluginManager;
415439
use Zend\Validator\ValidatorInterface;
416-
440+
417441
class MyPluginManager extends AbstractPluginManager
418442
{
419443
protected $instanceOf = ValidatorInterface::class;
420444
}
421445
```
422-
446+
423447
Of course, you can still override the `validate` method if your logic is more
424448
complex.
425449

@@ -463,17 +487,17 @@ changes, outlined in this section.
463487
service manager; you can pass the configuration array directly instead.
464488

465489
In version 2.x:
466-
490+
467491
```php
468492
$config = new \Zend\ServiceManager\Config([
469493
'factories' => [...]
470494
]);
471-
495+
472496
$sm = new \Zend\ServiceManager\ServiceManager($config);
473497
```
474-
498+
475499
In ZF 3.x:
476-
500+
477501
```php
478502
$sm = new \Zend\ServiceManager\ServiceManager([
479503
'factories' => [...]
@@ -502,7 +526,7 @@ changes, outlined in this section.
502526
argument if present.
503527

504528
For instance, here is a simple version 2.x factory:
505-
529+
506530
```php
507531
class MyFactory implements FactoryInterface
508532
{
@@ -512,9 +536,9 @@ changes, outlined in this section.
512536
}
513537
}
514538
```
515-
539+
516540
The equivalent version 3 factory:
517-
541+
518542
```php
519543
class MyFactory implements FactoryInterface
520544
{
@@ -544,23 +568,23 @@ changes, outlined in this section.
544568
through the interface.
545569

546570
In version 2.x, if a factory was set to a service name defined in a plugin manager:
547-
571+
548572
```php
549573
class MyFactory implements FactoryInterface
550574
{
551575
function createService(ServiceLocatorInterface $sl)
552576
{
553577
// $sl is actually a plugin manager
554-
578+
555579
$parentLocator = $sl->getServiceLocator();
556-
580+
557581
// ...
558582
}
559583
}
560584
```
561-
585+
562586
In version 3:
563-
587+
564588
```php
565589
class MyFactory implements FactoryInterface
566590
{

src/AbstractPluginManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
4-
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
5-
* @license http://framework.zend.com/license/new-bsd New BSD License
3+
* @see https://github.com/zendframework/zend-servicemanager for the canonical source repository
4+
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com)
5+
* @license https://github.com/zendframework/zend-servicemanager/blob/master/LICENSE.md New BSD License
66
*/
77

88
namespace Zend\ServiceManager;

test/AbstractPluginManagerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* @link http://github.com/zendframework/zend-servicemanager for the canonical source repository
4-
* @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
5-
* @license http://framework.zend.com/license/new-bsd New BSD License
3+
* @see https://github.com/zendframework/zend-servicemanager for the canonical source repository
4+
* @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (http://www.zend.com)
5+
* @license https://github.com/zendframework/zend-servicemanager/blob/master/LICENSE.md New BSD License
66
*/
77

88
namespace ZendTest\ServiceManager;

0 commit comments

Comments
 (0)