-
Notifications
You must be signed in to change notification settings - Fork 193
fix delegators config key #346
Conversation
|
I think the delegator factory class need to be updated as well to implements DelegatorFactoryInterface |
|
Hello @samsonasik, I agree... |
samsonasik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use DelegatorFactoryInterface from ServiceManager\Factory namespace
| use Zend\Stratigility\MiddlewarePipe; | ||
|
|
||
| class ApiResourcePipelineDelegatorFactory | ||
| class ApiResourcePipelineDelegatorFactory implements DelegatorFactoryInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to use DelegatorFactoryInterface from ServiceManager\Factory namespace so we use :
public function __invoke(
ContainerInterface $container,
$name,
callable $callback,
array $options = null
)|
@samsonasik |
added blank lines for clarity in the example (as it was done in the ApiResourcePipelineDelegatorFactory example): - retrieve the service - alter/extend the service - return the altered/extended service (should we add inline code comments?)
|
@samsonasik |
|
it seems ok now 👍 |
|
There's a problem with this patch: the original documentation was demonstrating the zend-servicemanager v2 API, but the changes introduced show only the v3 API. The Expressive installer, and the default configuration, supports both. Ideally, we should be:
This means more code in the examples, but will ensure that the code, if copy and pasted into an application, will work regardless of the zend-servicemanager version installed by the user. If I can get back to this today, I'll use your changes as a starting point. If you do not see activity from me, and you have a chance to update, please do. Thanks! |
|
@weierophinney , sure! kind regards! |
|
@pine3ree I'd updated the zend-form examples with a previous documentation patch, and have now pushed another patch that updates the route-specific pipeline examples. Both now demonstrate both v2 and v3 compatibility for the delegator factory examples. |
No description provided.