You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of the Laravel 11 upgrade (#879) Psalm stopped working again. I'm considering to switch to Larastan instead. Installing and running it is quite straight forward but it seems to be much stricter than Psalm so there will be lots of type issues to be resolved.
I tried it out and here are some issues I encountered:
The models with HasConstantInstances (e.g. Role) need @method annotations like this:
/**
* A role of a user. Users have one global role and can have many project-
* specific roles.
*
* @method static Role admin()
* @method static Role adminId()
* @method static Role expert()
* @method static Role expertId()
* @method static Role editor()
* @method static Role editorId()
* @method static Role guest()
* @method static Role guestId()
*/
class Role extends Model
Some Models that use inheritance (e.g. Annotation) need explicit property annotations, as Larastan cannot infer the properties from the migrations.
There are lots of inconsistent PHPDoc types.
Many controller methods have a wrong type annotation because I was too lazy.
All in all this will be some work but I think the stricter checks will only improve the codebase.
The text was updated successfully, but these errors were encountered:
As part of the Laravel 11 upgrade (#879) Psalm stopped working again. I'm considering to switch to Larastan instead. Installing and running it is quite straight forward but it seems to be much stricter than Psalm so there will be lots of type issues to be resolved.
I tried it out and here are some issues I encountered:
HasConstantInstances
(e.g. Role) need@method
annotations like this:All in all this will be some work but I think the stricter checks will only improve the codebase.
The text was updated successfully, but these errors were encountered: