Remove duplicate dollar sign for inherited variables #789

Merged
merged 1 commit into from Apr 3, 2013

Projects

None yet

2 participants

@flack
Contributor
flack commented Mar 26, 2013

You don't need to add a dollar sign when concatenating the class and variable names, this will only lead to output like parent_class::$$variable. The dollar sign for properties is already in the structure.xml

@flack flack Remove duplicate dollar sign for inherited variables
You don't need to add a dollar sign when concatenating the class and variable names, this will only lead to output like `parent_class::$$variable`. The dollar sign for properties is already in the structure.xml
f1ebc6c
@mvriel
Member
mvriel commented Mar 27, 2013

Looking good! Have you tested it with several templates or just responsive?

@flack
Contributor
flack commented Mar 28, 2013

Just with responsive, but could choice of template even make a difference here? I thought that structure.xml was the same for all templates and that behaviors are configured separately. I might be wrong though, I haven't really looked that deeply into phpdoc's architecture :-)

@mvriel
Member
mvriel commented Apr 3, 2013

The structure file is the same; I just don't know if the other templates do not prepend a dollar sign. This would effectively delete it for them.

I am all for the change; just not sure whether it will carry well without testing (and I am running short in time :()

@flack
Contributor
flack commented Apr 3, 2013

AFAICT the template does not even have the possibility to use only half the string (if it did, I would have fixed the problem in my template instead of going through the hassle of opening a pull request :-)). The value from getReferrerString is written into refers (https://github.com/phpDocumentor/phpDocumentor2/blob/develop/src/phpDocumentor/Plugin/Core/Transformer/Behaviour/Inherit/Node/PropertyNode.php#L91) and description (https://github.com/phpDocumentor/phpDocumentor2/blob/develop/src/phpDocumentor/Plugin/Core/Transformer/Behaviour/Inherit/Node/PropertyNode.php#L95) attributes and is f.x. used here: https://github.com/phpDocumentor/template.responsive/blob/master/elements/common.xsl#L157. The only way for a template to use only the variable name would be by doing a regex on the attribute value, at which point the dollar sign problem will already be addressed by the regex itself.

@mvriel
Member
mvriel commented Apr 3, 2013

Thanks for looking that up for me, it gives me the confidence to merge this without testing it locally; merging now :)

@mvriel mvriel merged commit af4289f into phpDocumentor:develop Apr 3, 2013

1 check failed

Details default The Travis build could not complete due to an error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment