Access to an undefined property $form

Inside a custom component with a Filament form how to keep PhpStan happy with error:
Access to an undefined property $form
When I declare it protected $form; the fill method throws error:
Call to a member function fill() on null
Type hinting with form
$form must not be accessed before initialization
Solution:
Add a phpdoc /** @property Form $form */ to the class
Jump to solution
2 Replies
Solution
Dennis Koch
Dennis Koch2y ago
Add a phpdoc /** @property Form $form */ to the class
gizmojo
gizmojoOP2y ago
@Dennis Koch wow you are rapid worked cheers
Want results from more Discord servers?
Add your server