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

Filtering default stub files on Windows #2406

Merged
merged 2 commits into from
Jul 6, 2023
Merged

Conversation

maryo
Copy link
Contributor

@maryo maryo commented May 16, 2023

ComposerHelper::getVendorDirFromComposerConfig($this->currentWorkingDirectory, $composerConfig)
returns path separated by / ($root . '/' . trim($vendorDirectory, '/')) and $composerConfig['config']['vendor-dir'] could contain both separators.

On Windows, $this->getStubFiles() returns paths separated by \. So the vendor stub files are never filtered out on Windows.

getVendorDirFromComposerConfig could already return it normalized but I was not brave enough to change it.

@phpstan-bot
Copy link
Collaborator

You've opened the pull request against the latest branch 1.11.x. If your code is relevant on 1.10.x and you want it to be released sooner, please rebase your pull request and change its target to 1.10.x.

@maryo maryo changed the base branch from 1.11.x to 1.10.x May 16, 2023 19:39
@maryo maryo marked this pull request as draft May 16, 2023 20:47
@maryo maryo marked this pull request as ready for review May 16, 2023 20:59
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes
Copy link
Member

This change needs a test (that fails when the changes in src/ are removed).

@maryo maryo force-pushed the patch-1 branch 3 times, most recently from d3d57d2 to 483609f Compare May 17, 2023 18:25
@maryo
Copy link
Contributor Author

maryo commented May 17, 2023

I see. Some tests added.
testGetProjectStubFilesWhenPathContainsWindowsSeparator fails without the changes

@ondrejmirtes ondrejmirtes merged commit e6976b6 into phpstan:1.10.x Jul 6, 2023
368 of 377 checks passed
@ondrejmirtes
Copy link
Member

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
3 participants