Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix an issue with inheritance of placeholder registry #3307

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Contributor

lisachenko commented Dec 29, 2012

This small patch fixes an issue with logic of Registry getRegistry() method. Method should use static keyword instead of self to allow inheritance.

Issue was detected automatically during the tests with aspect-oriented programming in ZF2 https://github.com/lisachenko/zf2-aspect

Contributor

samsonasik commented Dec 30, 2012

@lisachenko : i found 48 new self() in other class

Contributor

lisachenko commented Dec 30, 2012

@samsonasik should I replace all of them to static when LSB is used?

Contributor

samsonasik commented Dec 30, 2012

with php 5.3, i think new static is more usable then new self, . cmiiw

Contributor

lisachenko commented Dec 30, 2012

@samsonasik yes, extending logic of class will be more usable with LSB, especially for Ldap filter, added patch for that.

Contributor

samsonasik commented Dec 30, 2012

nice 👍

Contributor

lisachenko commented Dec 30, 2012

Thanks, it's my first PR to ZF2 ))

P.S. I'm working on AOP for PHP if you could take a look at it, I would be grateful to you ))

Demo source code is here https://github.com/lisachenko/zf2-aspect. Here is a snapshot what my library can do with ZF2 demo application https://twitter.com/lisachenko/status/281124645615329280 (no extensions: runkit, aop, etc, no evals, no __call methods, just pure PHP code).

Contributor

samsonasik commented Dec 31, 2012

You're welcome. Great ! ok, forked :)

Pada Dec 31, 2012, at 0:51, Alexander Lisachenko notifications@github.com menulis:

Thanks, it's my first PR to ZF2 ))

P.S. I'm working on AOP for PHP if you could take a look at it, I would be grateful to you ))

Demo source code is here https://github.com/lisachenko/zf2-aspect. Here is a snapshot what my library can do with ZF2 demo application https://twitter.com/lisachenko/status/281124645615329280 (no extensions: runkit, aop, etc, no evals, no __call methods, just pure PHP code).


Reply to this email directly or view it on GitHub.

@weierophinney weierophinney commented on the diff Jan 3, 2013

library/Zend/Code/Generator/PropertyGenerator.php
@@ -39,7 +39,7 @@ class PropertyGenerator extends AbstractMemberGenerator
*/
public static function fromReflection(PropertyReflection $reflectionProperty)
{
- $property = new self();
+ $property = new static();
@weierophinney

weierophinney Jan 3, 2013

Owner

It appears this one may cause an issue -- travis reports a failing test for the PropertyGenerator here.

Owner

weierophinney commented Jan 3, 2013

Actually, I'm having trouble tracking down the issue. Essentially, ZendTest\Code\Generator\PropertyGeneratorTest::testPropertyMultilineValue is failing, and it appears that in addition to adding a "," after each element of an array, it's also adding a ";" before the comma. As this does not happen on master, I have to assume the issue is due to adding LSB; the question is: where.

@lisachenko Can you track it down?

Contributor

lisachenko commented Jan 4, 2013

@weierophinney yeah, looks strange...LSB shouldn't break anything. I'll look into the issue

Contributor

lisachenko commented Jan 4, 2013

LSB is the issue ) Class PropertyValueGenerator extends ValueGenerator class and overrides generate() method. So new static() in the ValueGenerator class can not be used because it will create child instead of self.

I'll amend my last commit to be compatible with current logic, however it's better to fix this issue later. Is amending commit is ok for PR?

weierophinney added a commit that referenced this pull request Jan 4, 2013

Merge branch 'hotfix/3307' into develop
Forward port #3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php
Owner

weierophinney commented Jan 4, 2013

Excellent - thanks!

@ghost ghost assigned weierophinney Jan 4, 2013

weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015

weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-uri that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-uri that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-crypt that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-crypt that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-xmlrpc that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-xmlrpc that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-http that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-server that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-server that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-ldap that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-ldap that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-json that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-mime that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-mime that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-view that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php

weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015

weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015

Merge branch 'hotfix/3307' into develop
Forward port zendframework/zendframework#3307

Conflicts:
	library/Zend/Code/Generator/DocBlock/Tag/LicenseTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ParamTag.php
	library/Zend/Code/Generator/DocBlock/Tag/ReturnTag.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment