Skip to content

Remove SplObjectStorage #276

@gnat42

Description

@gnat42

SplObjectStorage is currently used to store what amount to an array of exceptions objects. I'm suggesting it be changed to an actual array for the following reasons.

  • You cannot inspect the storage contents via xdebug
  • Iterating the SplObjectStorage is non-intuitive in comparison to a basic array
  • Performance between the two is nearly identical until the number of records reaches a number high enough that in reality an OOM would occur with a data-importer of any complexity
  • Its much better suited to be used as a map/set but in this case isn't really useable that way as it stores exceptions so no one will be doing $exceptions->contains($exceptionObj)
  • It doesn't offer anything better than a standard array and creates a more complex hoop to jump through in post processing for new developers inspecting its contents.

I don't mind submitting a PR for this. I'm adding it as an issue because I've submitted 13 pull requests recently, all of which have received no response and my work uses the SplObjectStorage and adds another one. Anyway, if this issue was agreed upon, I'd submit a PR that could be merged before or after my other ones depending on review etc..

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