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

Fix an issue with inheritance of placeholder registry #3307

Closed
wants to merge 2 commits into from
Closed

Fix an issue with inheritance of placeholder registry #3307

wants to merge 2 commits into from

Conversation

lisachenko
Copy link
Contributor

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

@samsonasik
Copy link
Contributor

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

@lisachenko
Copy link
Contributor Author

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

@samsonasik
Copy link
Contributor

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

@lisachenko
Copy link
Contributor Author

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

@samsonasik
Copy link
Contributor

nice 👍

@lisachenko
Copy link
Contributor Author

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).

@samsonasik
Copy link
Contributor

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.

@@ -39,7 +39,7 @@ class PropertyGenerator extends AbstractMemberGenerator
*/
public static function fromReflection(PropertyReflection $reflectionProperty)
{
$property = new self();
$property = new static();
Copy link
Member

Choose a reason for hiding this comment

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

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

@weierophinney
Copy link
Member

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?

@lisachenko
Copy link
Contributor Author

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

@lisachenko
Copy link
Contributor Author

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
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
@weierophinney
Copy link
Member

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
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
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
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
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
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
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
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
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
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
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
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
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
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 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.

None yet

3 participants