Skip to content

fix build#2625

Merged
jaapio merged 1 commit intophpDocumentor:masterfrom
orklah:fix-build
Oct 14, 2020
Merged

fix build#2625
jaapio merged 1 commit intophpDocumentor:masterfrom
orklah:fix-build

Conversation

@orklah
Copy link
Copy Markdown
Contributor

@orklah orklah commented Oct 14, 2020

This PR should fix the build.

The issue happened because in Psalm's last release, a stub for SplPriorityQueue was added in vimeo/psalm#4255.

Unfortunately, the order of the templates don't match with the existing one in PhpStan:
https://github.com/phpstan/phpstan-src/blob/6a38951c5cf040db5cae0e8e229064320a751413/stubs/spl.stub#L69
https://github.com/vimeo/psalm/blob/446a833d18419a5876ce5784ebe4309e33b89c64/stubs/CoreGenericClasses.phpstub#L1677

Furthermore, it seems phpstan doesn't read @phpstan-template-extends so I had to define the phpstan version as @template-extends and use @psalm-template-extends for the psalm version

@muglug @ondrejmirtes Maybe static analysis tools should have stubs in common, similar to the functions map to avoid this kind of issues?
@muglug For this case, the Psalm order seems more logical to me but the PhpStan one is older, meaning changing Psalm's one will break less things. Would you agree on a PR for this?

@ondrejmirtes
Copy link
Copy Markdown

When PHPStan is adding some stub for an SPL class, I also check Psalm stubs for compatibility. Psalm devs should do the same when they're adding SPL stubs as well. Since PHPStan was the first one with the stub, it's the Psalm one that should change to be compatible with PHPStan :)

I'm not going to change the stub in PHPStan because it would be an unnecessary BC break for PHPStan's users.

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