Skip to content

RemoveElement return type nullable? #413

Description

@bOmBeLq

Hello,
so here is issue in doctrine with LazyCollections doctrine/orm#8739 (comment)
Long story short if collection is lazy and we call remove() ideally we don't want to load whole collection into memory.
This can be implemented but there is issue with return type of remove(). When calling it on lazy collection we don't know if element is within collection or not. Therefore cannot return bool true/false.
So ideally I'd change Collection::removeElement : bool to Collection::removeElement : bool|null with description that null is returned if removal cannot be confirmed (eg. lazy collection)
Does that make sense?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions