I have a project that use this bundle with symfony version 5.4. When I run PHP unit tests. A warning is output:
1x: Method "Symfony\Component\Form\DataTransformerInterface::reverseTransform()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Vich\UploaderBundle\Form\DataTransformer\FileTransformer" now to avoid errors or add an explicit @return annotation to suppress this message.
To stop all this warnings, just modify code to add a return type. For example for FileTransformer warning:
Before:
/**
* {@inheritdoc}
*/
public function reverseTransform()
{
...
}
After:
/**
* {@inheritdoc}
*/
public function reverseTransform(): ?UploadedFile
{
...
}
Or
/**
* {@inheritdoc}
*
* @return UploadedFile|null
*/
public function reverseTransform()
{
...
}
BC Break Report
Summary
I have a project that use this bundle with symfony version 5.4. When I run PHP unit tests. A warning is output:
1x: Method "Symfony\Component\Form\DataTransformerInterface::reverseTransform()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Vich\UploaderBundle\Form\DataTransformer\FileTransformer" now to avoid errors or add an explicit @return annotation to suppress this message.
To stop all this warnings, just modify code to add a return type. For example for FileTransformer warning:
Before:
After:
Or