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

Return type conflict in UploadedFileInfo #32

@mmarton

Description

@mmarton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions