Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Return type conflict in UploadedFileInfo #32

Open
mmarton opened this issue Jan 11, 2022 · 0 comments
Open

Return type conflict in UploadedFileInfo #32

mmarton opened this issue Jan 11, 2022 · 0 comments

Comments

@mmarton
Copy link

mmarton commented Jan 11, 2022

Hi!

There is a type conflict here:

https://github.com/antishov/StofDoctrineExtensionsBundle/blob/master/Uploadable/UploadedFileInfo.php#L29

the implemented interface returns string|null

https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/src/Uploadable/FileInfo/FileInfoInterface.php#L31

and the used UploadedFile class returns int|false (inherited from SplFileInfo)

https://www.php.net/manual/en/splfileinfo.getsize.php

At the docs there is a part which says:

https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/configuration.html

# Default file info class implementing FileInfoInterface: Optional. By default we provide a class which is prepared to receive an UploadedFile instance.
default_file_info_class: Stof\DoctrineExtensionsBundle\Uploadable\UploadedFileInfo

So this could be an issue on doctrine-extension's side. idk

I don't have any idea how can this be fixed without BC.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant