Skip to content

[12.x] Improve typing in console/command namespace#58565

Merged
taylorotwell merged 17 commits intolaravel:12.xfrom
shaedrich:improve-command-types
Feb 1, 2026
Merged

[12.x] Improve typing in console/command namespace#58565
taylorotwell merged 17 commits intolaravel:12.xfrom
shaedrich:improve-command-types

Conversation

@shaedrich
Copy link
Contributor

Benefits

✅ Improved static analysis
✅ Improved type inference
✅ Increased type coverage

Highlights

  • Typing of arrays
  • Typing of closures
  • Using constants, union string literals, and class-string instead of wider primitive types where possible
  • Using generics to determine return types

Approach

  • Many types are inferred from usage
  • Some types are taken from the Symfony code base when classes extended or wrapped Symfony

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