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

Minor: PhpParser autload inconsistency. #179

Closed
remicollet opened this issue Nov 29, 2014 · 0 comments
Closed

Minor: PhpParser autload inconsistency. #179

remicollet opened this issue Nov 29, 2014 · 0 comments

Comments

@remicollet
Copy link
Contributor

 // nikic's PHPParser
 if (!class_exists('PhpParser\Autoloader', true)) {
      require __DIR__ . '/../vendor/nikic/php-parser/lib/bootstrap.php';
 }

The test (class_exists) is not consistent with action in php-parser/lib/bootstrap.php (declare the autoloader class AND register an autoloader)

This can raise issue if "autoload" can find the class, as the "register" will not be run.
Simple Proposal:

  if (!class_exists('PhpParser\Autoloader', false)) {

Or simply drop this test and use "require_once"

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

No branches or pull requests

1 participant