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

Parser error #4

Closed
rockoo opened this issue Jan 18, 2019 · 5 comments
Closed

Parser error #4

rockoo opened this issue Jan 18, 2019 · 5 comments

Comments

@rockoo
Copy link

rockoo commented Jan 18, 2019

There is some failure half through analysis and it throws the following exception:

.PHP Fatal error: Uncaught PhpParser\Error: Unexpected null byte on line 1 in ...vendor/nikic/php-parser/lib/PhpParser/Lexer.php:100

@NielsdeBlaauw
Copy link
Owner

Thanks @rockoo for the bug report. This seems to be the problem I found in #1. It basically means the file you are checking is not a valid php file.

For #1 I will improve how these exceptions are handled. Do you mind if I ask you to try the same run again after I have fixed it, to see if that also fixes this issue?

@petardfoozer
Copy link

I had the same issue when running this on my entire project. I'm using a custom framework that includes php files, js files, html files, etc.

By specifying the directory/file I want to scan I avoid this error.

Example:

$vendor/bin/php-doc-check -d /Users/myuser/Documents/projects/myproject/private/Models

This scans my entire Models directory which contains only PHP files, hence no invalid php file errors

@NielsdeBlaauw
Copy link
Owner

Hi @rockoo, @petardfoozer

The fix of #1 is now merged and should also resolve this issue. Could you retry the command that failed before, to see if it no longer crashes on unparsable files?

@NielsdeBlaauw
Copy link
Owner

I am considering this fixed.

@rockoo
Copy link
Author

rockoo commented Mar 14, 2019

@NielsdeBlaauw thank you for fast response and sorry for my late reply. For some reason I didnt get an email nor it showed me notification.

It is fixed! Thank you

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

3 participants