Post

GSoC 2026 Week 12: PHPStan Level 6 Progress and Error Cleanup

GSoC 2026 Week 12: PHPStan Level 6 Progress and Error Cleanup

This week, I moved on to PHPStan Level 6 and started reducing the remaining issues in the baseline. I have completed 30 percent of the Level 6 PHPStan issues so far.


1. Level 6 Error Summary

While working on PHPStan Level 6, I came across a total of 78 issues. Most of the issues were related to missing type information and Laravel Eloquent relationships.

35 issues - Missing generic types: Added proper type information to Eloquent relationships such as HasMany, BelongsTo, HasOne, MorphMany, and HasFactory. I picked this issues first because they were the highest volume and were easy to fix with proper type annotations.


2. What I Resolved So Far

The main work this week was to start cleaning up the highest-volume issues first, especially the generic type annotations on Eloquent relationships and the missing iterable value types.

These are the areas that matter most right now:

  • missingType.generics on model relationships and factory traits.
  • missingType.iterableValue on arrays used in models, helpers, and controller methods.
  • method.unresolvableReturnType where callback type information needs to be made explicit.
  • missingType.parameter and missingType.return in smaller methods that still need proper signatures.

3. Next Week Plan

Next week I will continue to work on the remaining PHPStan Level 6 issues.


Acknowledgement

Thank you Mua Rachmann and Robby O’Connor for your continuous guidance and feedback.

Thanks for following my GSoC journey.

This post is licensed under CC BY 4.0 by the author.