Skip to content

Pass PHPStan for Laravel 12 #2674

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

Closed
wants to merge 12 commits into from
Closed

Conversation

gabsource
Copy link

@gabsource gabsource commented Mar 25, 2025

Fixes :

  • PHPDoc tag @return contains generic type PHPUnit\Framework\MockObject\Builder\InvocationMocker but class PHPUnit\Framework\MockObject\Builder\InvocationMocker is not generic.

  • Method PHPUnit\Framework\MockObject\Builder\InvocationMocker::with() invoked with unpacked array with possibly string key, but it's not allowed because of @no-named-arguments.

  • Added or updated tests

  • Documented user facing changes

  • Updated CHANGELOG.md

Changes

Breaking changes

@gabsource gabsource marked this pull request as ready for review March 25, 2025 10:02
@gabsource
Copy link
Author

gabsource commented Mar 25, 2025

@spawnia There is only one commit that changes actual code. Removal of unset was required to pass PHP 8.4.

05cf366

@@ -94,11 +94,11 @@ public function testDeleteSubscriber(): void
$subscriber = new DummySubscriber($channel, 'test-topic');
$redisConnection->expects($this->exactly(3))
->method('command')
->with(...$this->withConsecutive(
->with(...array_values([...$this->withConsecutive(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->with(...array_values([...$this->withConsecutive(
->with(...array_values($this->withConsecutive(

spreading once should suffice

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fails with the following error without "double spreading".

Parameter #1 $array of function array_values expects array, iterable<PHPUnit\Framework\Constraint\Callback> given.
🪪 argument.type
✏️ tests/Unit/Subscriptions/Storage/RedisStorageManagerTest.php:97

@spawnia spawnia deleted the branch nuwave:laravel-12 March 25, 2025 16:18
@spawnia spawnia closed this Mar 25, 2025
@spawnia
Copy link
Collaborator

spawnia commented Mar 25, 2025

Thank you, I incorporated parts of your pull request and just released https://github.com/nuwave/lighthouse/releases/tag/v6.54.0.

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.

2 participants