Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with doubling classes with methods named like keywords #49

Open
zloyrusskiy opened this issue Sep 5, 2013 · 2 comments
Open

Comments

@zloyrusskiy
Copy link

I tried to test code which uses GearmanWorker class from gearman extension. This class has method named "clone", that was ok in php v4, but in php v5 it is a keyword, and test failing with message:

PHP Parse error:  syntax error, unexpected 'clone' (T_CLONE), expecting identifier (T_STRING) in /somepath/vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php(48) : eval()'d code on line 13

P.S. to test this behaviour you can add

/**
 * @param  GearmanWorker $gw
 */

to any method (with gearman extension installed)

@everzet
Copy link
Member

everzet commented Nov 6, 2013

You need to provide a custom ClassPatch for each internal problem like that:
https://github.com/phpspec/prophecy/tree/master/src/Prophecy/Doubler/ClassPatch

I can do it myself, but it will take time :(

@mbrodala
Copy link

It seems like 2814b92 already added a handling for clone, maybe this is fixed already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants