[Zend-Code] Fix Code Generation for non namespace classes #4988

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

danez commented Aug 20, 2013

ClassGenerator and ParameterGenerator had some issues with non-namespace classes.

The ClassGenerator tried to concatenate the namespace in the check if a reflectionmethod is from the same class.

The ParameterGenerator removed the first character for non-namespace classnames.
And there is a backslash missing for non-namespace classnames. As zf2 requires 5.3.3 this slash does not hurt anyone.

Owner

weierophinney commented Aug 20, 2013

Please add unit tests.

Contributor

danez commented Aug 21, 2013

Added unit tests before fixing issue.

Daniel Tschinder and others added some commits Aug 21, 2013

Daniel Tschinder Added tests for issue #4988 1e3f5f6
@danez danez If no namespace used do not try to concatenate the namespace
If using ClassGenerator for non namespace classes no methods are found inside classes, as the classname check fails always.
b81c8ad
@danez danez Only try to remove the namespace from a classname if there is a names…
…pace and add backslash for non namespace classes

For non-namespace classes this substr/strlen algorithm removed the first character of the classname.
The slash is needed when generating namespace classes, which use non-namespace classes.
29dbe1a
Contributor

danez commented Aug 21, 2013

Same here, composer on travis not working atm -> failed

danez closed this Aug 21, 2013

danez reopened this Aug 21, 2013

@weierophinney weierophinney added a commit that referenced this pull request Aug 21, 2013

@weierophinney weierophinney Merge pull request #4988 from Danez/master
[Zend-Code] Fix Code Generation for non namespace classes
212d55e

@weierophinney weierophinney added a commit that referenced this pull request Aug 21, 2013

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