Description of the bug
Each constructor has a $label parameter which can be a string or an array.
Currently, docblocks only specify that $label can be a string, making the docblock incorrect.
This causes issues with code quality tools like phpstan.
Steps To Reproduce
- Set up
phpstan on a project with wordpress-fieldmanager
- Register a new Fieldmanager field, specifying an
array for $label, e.g.
new \Fieldmanager_Group(
[
'name' => 'settings',
'children' => [
'api_key' => new \Fieldmanager_TextField( __( 'API Key', 'wp-plugin' ) ),
],
]
);
- Run
phpstan
- Notice errors like
Parameter #1 $label of class Fieldmanager_Group constructor expects string, array<string, array<string, Fieldmanager_TextField>|string> given.
Additional Information
No response