Skip to content

MailEditor::theme(): type the closure loosely - #6

Merged
do-io merged 1 commit into
mainfrom
fix/theme-closure-type
Oct 8, 2026
Merged

do-io merged 1 commit into
mainfrom
fix/theme-closure-type

Conversation

@do-io

@do-io do-io commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

A PHPDoc-only fix. MailEditor::theme() was documented as taking Closure(): (array|null), i.e. a closure with no parameters, but a Filament closure may take injected parameters ($get, $record, ...), and the documented use is fn (Get $get): array => .... PHPStan in crm-pro rejected exactly that call. The parameter is now array|Closure, with the docblock saying what a closure may take. No behaviour change; 111 tests, PHPStan and Pint pass. For a v2.2.1 patch release.

🤖 Generated with Claude Code

A Filament closure may take injected parameters such as $get, so the docblock no longer claims it takes none.
Static analysis in a project that passes fn (Get $get) rejected the narrower type.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@do-io
do-io merged commit 2cf9725 into main Oct 8, 2026
14 checks passed
@do-io
do-io deleted the fix/theme-closure-type branch October 11, 2026 19:58
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