Recent posts with #phpstan

Thrilled to announce that I'll be speaking at the next Laravel Ahmedabad Meetup! 🎉

I'll be diving into the world of PHP Types and exploring the power of PHPStan to enhance code quality. Whether you're new to static analysis or already using it, this talk will offer valuable insights to elevate your development process.

Join us on October 20th at 7Span HQ for a knowledge-packed talk! 💻

Date: October 20th, 10 AM
Venue: 7Span HQ, Ahmedabad

Looking forward to connecting with fellow developers and sharing ideas!

🎟️ bit.ly/laravel-meetup-ahmedabad-oct-2024



#Laravel #PHP #PHPStan
image

1

81

Hi if you know #phpstan I need to ask you something.

I'm trying to introduce it on a project that runs github.com/roblesterjr04/EloquentSalesForce

and because of a issue I have to get the first element of a query with ->get()->first() so basically performing an inefficient action on the collection.

Now running phpstan level 0 I get the error " Called 'first' on Laravel collection, but could have been retrieved as a query" everywhere. Is it possible to disable only that rule?

2

157

Improve your Laravel code,

Declaring @var @return annotations will improve IDE autocompletions. and get more clear idea what keys used.

If you have an array then you can use this.

#PHPStan

image

214