Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 17, 2024

fixes 1 of the test errors. one remaining but I am not sure yet whether its a problem in the test or the impl.

underlying problem was

<?php

var_dump(fnmatch(
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File\*',
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File/data/excluded-file.php',
	FNM_NOESCAPE | FNM_CASEFOLD
));

var_dump(fnmatch(
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File\*',
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File\data\excluded-file.php',
	FNM_NOESCAPE | FNM_CASEFOLD
));

see https://3v4l.org/WAAkK

@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 2.0.x. PHPStan 2.0 is not going to be released for months. If your code is relevant on 1.12.x and you want it to be released sooner, please rebase your pull request and change its target to 1.12.x.

underlying problem was

```
<?php

var_dump(fnmatch(
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File\*',
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File/data/excluded-file.php',
	FNM_NOESCAPE | FNM_CASEFOLD
));

var_dump(fnmatch(
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File\*',
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File\data\excluded-file.php',
	FNM_NOESCAPE | FNM_CASEFOLD
));
```
@staabm
Copy link
Contributor Author

staabm commented Sep 17, 2024

the 1 remaing error is related to

<?php

var_dump(fnmatch(
	'tests\PHPStan\File\data\*',
	'C:\dvl\Workspace\phpstan-src-staabm\tests\PHPStan\File\data\parse-error.php',
	FNM_NOESCAPE | FNM_CASEFOLD
));

for this test-case:

[
__DIR__ . '\data\parse-error.php',
['tests/PHPStan/File/data/*'],
true,
],

@ondrejmirtes
Copy link
Member

The remaining error should be solved by changing the excluded path to *\tests\PHPStan\File\data\*. That's generally how it should be configured.

@ondrejmirtes ondrejmirtes merged commit aefc87a into phpstan:2.0.x Sep 17, 2024
191 of 216 checks passed
@ondrejmirtes
Copy link
Member

Awesome, thank you for your help!

@staabm staabm deleted the exc branch September 17, 2024 08:34
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.

3 participants