Skip to content

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented May 5, 2024

While it is possible to return a custom SplFileInfo object in the
iterator used by buildFromIterator(), the data is not actually used from
that object, instead the data from the underlying internal structure is
used. This makes it impossible to override some metadata such as the
path name and modification time.

The main motivation comes from two reasons:

  • Consistency. We expect our custom methods to be called when having a
    custom object.
  • Support reproducibility. This is the original use case as requested in
    [1].

Add support for this by calling the getMTime() and getPathname() methods
if they're overriden by a user class.

[1] theseer/Autoload#114.

nielsdos added 2 commits May 5, 2024 15:29
While it is possible to return a custom SplFileInfo object in the
iterator used by buildFromIterator(), the data is not actually used from
that object, instead the data from the underlying internal structure is
used. This makes it impossible to override some metadata such as the
path name and modification time.

The main motivation comes from two reasons:
- Consistency. We expect our custom methods to be called when having a
  custom object.
- Support reproducibility. This is the original use case as requested in
  [1].

Add support for this by calling the getMTime() and getPathname() methods
if they're overriden by a user class.

[1] theseer/Autoload#114.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant