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

Commit dc26f58

Browse files
committed
Merge branch 'hotfix/346'
Replaces and fixes #346
2 parents cc2633c + 4b61082 commit dc26f58

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

doc/book/cookbook/route-specific-pipeline.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,21 @@ middleware in order to change the instance or return an alternate instance. In
5858
this case, we'd do the latter. The following is an example:
5959

6060
```php
61+
use Interop\Container\ContainerInterface;
6162
use Zend\ServiceManager\DelegatorFactoryInterface;
6263
use Zend\ServiceManager\ServiceLocatorInterface;
6364
use Zend\Stratigility\MiddlewarePipe;
6465

65-
class ApiResourcePipelineDelegatorFactory
66+
class ApiResourcePipelineDelegatorFactory implements DelegatorFactoryInterface
6667
{
67-
public function createDelegatorWithName(
68-
ServiceLocatorInterface $container,
68+
/**
69+
* zend-servicemanager v3 support
70+
*/
71+
public function __invoke(
72+
ContainerInterface $container,
6973
$name,
70-
$requestedName,
71-
$callback
74+
callable $callback,
75+
array $options = null
7276
) {
7377
$pipeline = new MiddlewarePipe();
7478

@@ -83,6 +87,18 @@ class ApiResourcePipelineDelegatorFactory
8387

8488
return $pipeline;
8589
}
90+
91+
/**
92+
* zend-servicemanager v2 support
93+
*/
94+
public function createDelegatorWithName(
95+
ServiceLocatorInterface $container,
96+
$name,
97+
$requestedName,
98+
$callback
99+
) {
100+
return $this($container, $name, $callback);
101+
}
86102
}
87103
```
88104

@@ -98,7 +114,7 @@ return [
98114
'ValidationMiddleware' => '...',
99115
'ApiResourceMiddleware' => '...',
100116
],
101-
'delegator_factories' => [
117+
'delegators' => [
102118
'ApiResourceMiddleware' => [
103119
'ApiResourcePipelineDelegatorFactory',
104120
],

doc/book/cookbook/using-zend-form-view-helpers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ use Zend\ServiceManager\ServiceLocatorInterface;
104104
class FormHelpersDelegatorFactory
105105
{
106106
/**
107-
* zend-servicemanager v3 usage
107+
* zend-servicemanager v3 support
108108
*/
109109
public function __invoke(
110110
ContainerInterface $container,
@@ -121,7 +121,7 @@ class FormHelpersDelegatorFactory
121121
}
122122

123123
/**
124-
* zend-servicemanager v2 compatibility
124+
* zend-servicemanager v2 support
125125
*/
126126
public function createDelegatorWithName(
127127
ServiceLocatorInterface $container,

0 commit comments

Comments
 (0)