Advertisement Β· 728 Γ— 90
#
Hashtag
#Larastan
Advertisement Β· 728 Γ— 90
PHP code:

/** @var User $user */
if (is_null($user = auth()->user())) {

PHP code: /** @var User $user */ if (is_null($user = auth()->user())) {

Variable $user in PHPDoc tag @var does not exist.
varTag.variableNotFound

Variable $user in PHPDoc tag @var does not exist. varTag.variableNotFound

Any PHPStan/Larastan experts out there? Currently on level 2 and getting an error about a missing var. I don't really want to add another line to fix nor do I want to ignore this line, is there a better way?

Maybe @jclermont knows?

#laravel #larastan

0 2 2 0
Preview
15 Laravel Security Best Practices in 2025 Laravel is one of the most popular PHP frameworks, and for good reasonβ€”it's elegant, expressive, and...

#7 πŸ” Run regular security audits using #Larastan, #PHPStan and security checkers
dev.to/sharifcse58...

0 0 0 0

Using Larastan in Laravel projects, even gradually, is key to improving code quality and preventing errors. Start small and increase the level of rigor over time. The results will show in the long run! #Laravel #Larastan #PHP #Development

1 0 0 0

FINALLY

Hopefully this is worth it.

#larvel #larastan

1 0 0 0
helper.php

helper.php

If you're adding #larastan to your project and don't want to lose your mind then add this helper file and include it in composer autoload.

#laravel #phpstan #phptypessuckomg

4 0 1 0
Larastan 777 errors FML

Larastan 777 errors FML

Sooo... is this worth fixing?

#laravel #larastan

4 0 2 1

How do you handle generics in a base interface in order to pass PHPStan level 9? To be honest, I'm having a bit of a hard time, specially with Builder and TModel... πŸ˜…
#larastan

0 0 0 0

I have found that out the hard way #PHPStan #Larastan

1 0 1 0

Once again Larastan saves me from pushing a subtle bug into the wild. (Only to a test server, but still)

#laravel #larastan

3 0 0 0