Skip to content

Remove some Ds stubs for functionMap #4218

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

Merged
merged 2 commits into from
Aug 8, 2025

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Aug 8, 2025

Same idea than #4185
I checked the signature one by one.

More could be removed when PHPStorm will be fixed
JetBrains/phpstorm-stubs#1776

Reflection goldent test is lot of

-Has side-effects: Maybe
+Has side-effects: Yes

Wanted, there is a @throws on the method.

And one

PHPStan\Reflection\ReflectionProviderGoldenTest::test with data set "METHOD Ds\Deque::sorted" ('METHOD Ds\Deque::sorted', 'Is built-in: Yes\nHas side-ef...\Deque')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Variants: 1
     /**
      * @param (callable(TValue, TValue): int)|null $comparator
-     * @return Ds\Sequence<TValue (class Ds\Deque, parameter)>
+     * @return Ds\Deque
      */
     function sorted((callable(): mixed)|null $comparator = null): Ds\Deque'

/home/runner/work/phpstan-src/phpstan-src/tests/PHPStan/Reflection/ReflectionProviderGoldenTest.php:73

Then I discover there is also an ext-ds stub file in PHPStan so I updated it and now the change is an improvement

PHPStan\Reflection\ReflectionProviderGoldenTest::test with data set "METHOD Ds\Deque::sorted" ('METHOD Ds\Deque::sorted', 'Is built-in: Yes\nHas side-ef...\Deque')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Variants: 1
     /**
      * @param (callable(TValue, TValue): int)|null $comparator
-     * @return Ds\Sequence<TValue (class Ds\Deque, parameter)>
+     * @return Ds\Deque<TValue (class Ds\Deque, parameter)>
      */
     function sorted((callable(): mixed)|null $comparator = null): Ds\Deque'

/home/runner/work/phpstan-src/phpstan-src/tests/PHPStan/Reflection/ReflectionProviderGoldenTest.php:73

In another PR (and after PHPStorm PR will be merged), I'll try to get rid of the ext-ds.stub.

@VincentLanglet VincentLanglet force-pushed the ds-stub branch 3 times, most recently from 837f01a to ec5b5df Compare August 8, 2025 11:18
@VincentLanglet VincentLanglet marked this pull request as ready for review August 8, 2025 12:26
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit 9297fc6 into phpstan:2.1.x Aug 8, 2025
449 of 453 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
Development

Successfully merging this pull request may close these issues.

3 participants