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

Syntax error, unexpected '\' (T_NS_SEPARATOR) when using Zend-Code 3.0.3 #321

Closed
holtkamp opened this issue Jun 28, 2016 · 6 comments
Closed
Assignees
Milestone

Comments

@holtkamp
Copy link

holtkamp commented Jun 28, 2016

Running a composer update resulted in:

  - Removing zendframework/zend-code (3.0.2)
  - Installing zendframework/zend-code (3.0.3)
    Downloading: 100%         
    Extracting archive

    REASON: ocramius/proxy-manager 2.0.2 requires zendframework/zend-code ~3.0 -> satisfiable by zendframework/zend-code[3.0.2, 3.0.0, 3.0.1, 3.0.3, 3.1.x-dev, 3.0.x-dev].

After that the following parse error occurs:

   [exec] Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING) in /workspace/project/vendor/ocramius/proxy-manager/src/ProxyManager/GeneratorStrategy/EvaluatingGeneratorStrategy.php(68) : eval()'d code on line 3

Moving back to "zendframework/zend-code" : "3.0.2" resolves the problem.

The ProxyManager is used by www.php-di.org to define lazy injected definitions for the Dependency Injection Container.

Switched back to zend-code 3.0.3 and had the proxies written to file to check what generated code caused this:

class Generated172c7b213948b8ab21f1c1c819c2a322 extends \\Doctrine\DBAL\Configuration implements \\ProxyManager\Proxy\VirtualProxyInterface
{

Note the double prefixing path separator \\

Might be a zend-code thingie, but as the Proxymanager complains, reported it here.

Probably caused by zendframework/zend-code@d1f11ad

holtkamp referenced this issue in zendframework/zend-code Jun 28, 2016
@kdambekalns
Copy link

Can confirm the issue, using Neos and

  • ocramius/proxy-manager 2.0.2
  • zendframework/zend-code 3.0.3

as well.

@kdambekalns
Copy link

It's zend-code, see zendframework/zend-code#74

@Ocramius
Copy link
Owner

Keeping it open, but marking it as invalid, since zendframework/zend-code#74 is the cause of this.

@Ocramius Ocramius self-assigned this Jun 28, 2016
@Ocramius
Copy link
Owner

@holtkamp @kdambekalns can you try running a composer update and see if it actually works?

@holtkamp
Copy link
Author

holtkamp commented Jul 1, 2016

Yes, with zend-code "3.0.4" it works. Maybe you need to change the requirement in composer.json to specifically exclude 3.0.3 as suggested here: zendframework/zend-code#74 (comment)

@kdambekalns
Copy link

kdambekalns commented Jul 6, 2016

Late to the party, but yes: fixed with 3.0.4. Thanks!

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