Form: rely on specific setter #3610

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

Slamdunk commented Jan 30, 2013

Always rely on dedicated setter

Member

Maks3w commented Feb 1, 2013

I'll close this for the same reason discussed here zendframework#3558 (comment)

If you think that is wrong feel free to reopen it

Maks3w closed this Feb 1, 2013

Contributor

Slamdunk commented Feb 2, 2013

Hi, #3558 is right, accessing to internal property without using getter is fine.

The intention of this PR is different: I consider a setter the central point of constructing a dependancy. Look at this:
https://github.com/zendframework/zf2/blob/release-2.1.0/library/Zend/Mvc/Controller/AbstractController.php#L154-L189
If I want to build the event manager dependancy differently, I can just extend and overwrite only the setter.

So, accessing and using a direct property it's ok everywhere.
Building a new dependancy instead it's better to do it in only one place.

PS: Github doesn't let me reopen the issue :)

Maks3w reopened this Feb 2, 2013

weierophinney was assigned Feb 5, 2013

@weierophinney weierophinney added a commit that referenced this pull request Feb 5, 2013

@weierophinney weierophinney Merge branch 'hotfix/3610' into develop
Forward port #3610
ad74caa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment