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

Added allow comments flag #81

Merged
merged 1 commit into from
May 11, 2023
Merged

Conversation

vtsykun
Copy link
Contributor

@vtsykun vtsykun commented Feb 3, 2023

Fixes #58.

In this PR has been added flag ALLOW_COMMENTS to allow ignore the comments.

Example usage:

$parser = new JsonParser();
$data = $parser->parse($content, JsonParser::ALLOW_COMMENTS);

Without this flag, JSON validation works as before, so there are not BC break here.

@vtsykun
Copy link
Contributor Author

vtsykun commented Feb 4, 2023

Seems a bug in phpstan

Line   src/Seld/JsonLint/Lexer.php                        
 ------ --------------------------------------------------- 
  116    Method Seld\JsonLint\Lexer::lex() should return    
         -1|1|4|6|8|10|11|14|[17](https://github.com/Seldaek/jsonlint/actions/runs/4088800683/jobs/7056125751#step:7:18)|[18](https://github.com/Seldaek/jsonlint/actions/runs/4088800683/jobs/7056125751#step:7:19)|21|22|23|24 but returns  
         -1|0|1|4|6|8|10|11|14|17|18|21|22|23|24|30.        
 ------ ---------------------------------------------------

phpstan/phpstan#8719

@Seldaek
Copy link
Owner

Seldaek commented Feb 7, 2023

Thanks, looks good to me at first glance, will need some more time to review though

@Seldaek Seldaek merged commit 78a1ff3 into Seldaek:main May 11, 2023
@Seldaek
Copy link
Owner

Seldaek commented May 11, 2023

Thanks

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

Successfully merging this pull request may close these issues.

Allow comments
2 participants