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

[suggest] Ignore methods without parameters from aware interfaces #4918

Closed
wants to merge 3 commits into from
Closed

Conversation

tux-rampage
Copy link
Contributor

Some aware interfaces in ZF2 define setters which do not expect any parameter.
These setters are not thought to be called by the dependency injector.

It doesn't make sense anyway to process interface methods from aware interfaces that doesn't have parameters. Even worse: Di could call a method that it should not invoke.

@Ocramius
Copy link
Member

@tux-rampage the idea seems ok - just wondering why there would be aware interfaces without params, but that's another problem...

@tux-rampage
Copy link
Contributor Author

@Ocramius I'm wondering about this, too. But it doesn't bother me much.

Some define the getter as well as the setter. This is a design/philosophy discussion, IMHO not worth debating to much about it. We should give ZF2 consumers this flexibility, no matter if it makes sense to a group of people or not. I guess it doesn't hurt anyone.

* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @package Zend_Di
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove @Package

@weierophinney
Copy link
Member

@tux-rampage incorporate the feedback, and I'll review for merge.

@tux-rampage
Copy link
Contributor Author

@weierophinney I changed the code as requested.
But why so serious about explicit checks?

@weierophinney
Copy link
Member

@tux-rampage Because in this context, we could have a situation of testing 0 == '_construct', which would evaluate to true. :)

weierophinney added a commit that referenced this pull request Aug 28, 2013
[suggest] Ignore methods without parameters from aware interfaces
weierophinney added a commit that referenced this pull request Aug 28, 2013
- EOF markers
weierophinney added a commit that referenced this pull request Aug 28, 2013
@ghost ghost assigned weierophinney Aug 28, 2013
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
…di-fixes

[suggest] Ignore methods without parameters from aware interfaces
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-di that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants