IncludeMismatchSniff fails to recognize file extensions when require line ends in a semicolon
Auspicus opened this issue · 4 comments
Auspicus commented
To reproduce run the sniff over the following:
// Our extension should be picked up as .php
require "required_php_file.php";
/**
* Instead, the sniff fails to find the extension and we get an error:
* No file extension has been found in a include/require function.
* This implies that some PHP code is not scanned by PHPCS.
*/
jmarcil commented
Sorry but I can't reproduce that actually.
At first your PR made sense.. but then I realized that the regex is OK because it's actually matching over that full string "required_php_file.php"
it got from $tokens[$s]['content']
.
Can you create a full .php file for me to test on?
jmarcil commented
I can't still repro that bug.
@Auspicus can you validate on your end the issue is not happening anymore?
Thanks!
Auspicus commented
Yeah, you can go ahead and close. Not sure how to reproduce either at this point. It's passing on the same code that it failed on before. Maybe another commit had fixed it.
jmarcil commented
Thanks for the follow up!