wordpress-stubs
wordpress-stubs copied to clipboard
Support template for WP_Widget settings
The WP_Widget class supports passing an "$instance" array around which contains the value of the current widget settings.
Without a PHPStan template, adding a type to the $instance array results in warnings like "should be contravariant with parameter" for the following methods:
- form
- update
- widget
Having a template available allows using @extends to pass the array shape around.
As a bonus, this pull request also includes the full shape of the $args
passed to WP_Widget::widget