Skip to content

Conversation

@peterfox
Copy link
Collaborator

Changes

  • Adds AssertWithClassStringToTypeHintedClosureRector rule.
  • Adds a FacadeAssertionAnalyzer class.
  • Adds tests for the rule.
  • Updates the docs.

Why

Helps remove a redundant argument to the use of assertDispatched.

-Bus::assertDispatched(OrderCreated::class, function ($job) {
+Bus::assertDispatched(function (OrderCreated $job) {
     return true;
 });

Notes

This can probably be expanded further but I've left it as just Event and Bus assertDispatch calls.

@peterfox peterfox self-assigned this Mar 25, 2025
@peterfox peterfox changed the title Feature/assert class to type hinted closure Assert class to type hinted closure Mar 26, 2025
@GeniJaho GeniJaho merged commit 4649b0f into main Mar 27, 2025
5 checks passed
@GeniJaho GeniJaho deleted the feature/assert-class-to-type-hinted-closure branch March 27, 2025 14:28
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