Skip to content

Improve assert type specifying extension - #110

Merged
xificurk merged 6 commits into
masterfrom
improve-assert-type-specifying-extension
Sep 2, 2026
Merged

xificurk merged 6 commits into
masterfrom
improve-assert-type-specifying-extension

Conversation

@xificurk

@xificurk xificurk commented Sep 2, 2026

Copy link
Copy Markdown

No description provided.

xificurk and others added 6 commits September 2, 2026 21:12
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Slevomat sniffs enable checks based on the PHP version phpcs runs on:
native mixed type hints and trailing commas in multi-line declarations.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Assert::same(...$args) crashed the analysis with an ArgumentCountError,
Assert::null(...$args) specified `$args === null` and thus made all the
following code unreachable. Bail out instead of specifying anything when
the arguments cannot be resolved positionally.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PHPStan normalizes named arguments to their positions before invoking
the extension, but only when the call is valid - Assert::null(description: $x)
used to be read as Assert::null($x) and narrowed the description instead.

Also adds test coverage for regular named argument calls.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@xificurk
xificurk merged commit 2ef57b4 into master Sep 2, 2026
30 checks passed
@xificurk
xificurk deleted the improve-assert-type-specifying-extension branch September 2, 2026 19:56
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.

1 participant