Skip to content

Add PHPStan types #107

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

Open
HendrikN opened this issue Apr 16, 2025 · 3 comments · May be fixed by #108
Open

Add PHPStan types #107

HendrikN opened this issue Apr 16, 2025 · 3 comments · May be fixed by #108
Labels
enhancement New feature or request

Comments

@HendrikN
Copy link

HendrikN commented Apr 16, 2025

We all know that PHP is super awesome, of course! But it lacks some handy tooling, like generics, for example. While they are currently being re-evaluated, we're still years away from any kind of actual implementation.

Tools like Psalm or PHPStan (living in the phpdocs) would help our IDEs when dealing with the Collection and Itemresponses, providing better type inference for the entities they entail.

Psalm vs PHPStan
PHPStan is already supported by Illuminate\Support\Collection (and has more stars on GitHub), making it my preferred option.

For clarity, I'm not opting for making this package target some PHPStan level, just adding some @template-annotations for making our lives (and that of our IDE's) a little bit easier.

@JaZo
Copy link
Member

JaZo commented Apr 16, 2025

Good idea, a PR is more than welcome! Eventually we'd like to use PHPStan in this project, but let's focus on DX first!

@bbrala
Copy link
Member

bbrala commented Apr 16, 2025

👋

And yeah, PHPStan would be great to include. Actually kinda suprised we didn't get to that here already.

@HendrikN
Copy link
Author

Alrighty, I'll see what I can do next couple of days. The issue may be closed but i'll keep that up to you guys

@JaZo JaZo changed the title Would you accept a PR adding PHPStan types? Add PHPStan types Apr 16, 2025
@JaZo JaZo added the enhancement New feature or request label Apr 16, 2025
@HendrikN HendrikN linked a pull request Apr 18, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants