Describe the bug
PHPStan gives errors when doing things like :
public function configureActions(Actions $actions): Actions
{
$actions->update(Crud::PAGE_EDIT, Action::SAVE_AND_RETURN, function (Action $action) {
return $action->setHtmlAttributes(array_merge(
$action->getAsDto()->getHtmlAttributes(), [
'data-attr' => 'attr_value',
]
));
});
return $actions;
}
The error is :
Parameter #1 $attributes of method EasyCorp\Bundle\EasyAdminBundle\Config\Action::setHtmlAttributes() expects array<string, string>, array<string, string|Symfony\Contracts\Translation\TranslatableInterface> given.
This comes from the fact that on ActionDto, the method takes and returns array<string, string|TranslatableInterface>, whereas on Action it takes and returns array<string, string>.
To Reproduce
Run PHPStan on an example similar to the one given.
Describe the bug
PHPStan gives errors when doing things like :
The error is :
Parameter #1 $attributes of method EasyCorp\Bundle\EasyAdminBundle\Config\Action::setHtmlAttributes() expects array<string, string>, array<string, string|Symfony\Contracts\Translation\TranslatableInterface> given.This comes from the fact that on
ActionDto, the method takes and returnsarray<string, string|TranslatableInterface>, whereas onActionit takes and returnsarray<string, string>.To Reproduce
Run PHPStan on an example similar to the one given.