Skip to content

Add eager evaluation from closure method and update documentation.#43

Merged
gustavofreze merged 1 commit intomainfrom
feature/develop
Apr 16, 2026
Merged

Add eager evaluation from closure method and update documentation.#43
gustavofreze merged 1 commit intomainfrom
feature/develop

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 16, 2026 01:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds eager collection creation from a closure (mirroring the lazy closure factory) and updates docs/tests to describe and validate eager vs lazy evaluation behavior and complexity.

Changes:

  • Introduce Collection::createFromClosure() backed by an eager pipeline that materializes the closure result immediately.
  • Move first/isEmpty/last resolution into Pipeline implementations (eager/lazy) and remove the old resolving helpers.
  • Expand README + API docs with evaluation strategy and complexity explanations; add extensive tests and new test models.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/Models/Status.php Removes trailing whitespace from the enum file.
tests/Models/Shipments.php Adds a typed Shipments collection with a custom toArray() serializer.
tests/Models/ShipmentRecord.php Adds a record wrapper that maps raw arrays into typed shipments (eager + closure-based).
tests/Models/Shipment.php Adds a readonly shipment domain model + serializer for tests.
tests/EagerCollectionTest.php Adds comprehensive tests for eager createFromClosure behavior and typed collections.
tests/CollectionTest.php Updates closure-related tests to assert parity across lazy/eager closure sources; adds eager typed-collection test.
src/Internal/Pipeline.php Extends pipeline interface with first/isEmpty/last and documents complexities.
src/Internal/Operations/Transforming/RemoveAll.php Minor predicate null-check refactor.
src/Internal/Operations/Resolving/Last.php Removes old Last resolver helper (now handled by pipelines).
src/Internal/Operations/Resolving/First.php Removes old First resolver helper (now handled by pipelines).
src/Internal/LazyPipeline.php Implements first/isEmpty/last on lazy pipelines.
src/Internal/EagerPipeline.php Adds eager pipeline creation from closure + implements first/isEmpty/last.
src/Collection.php Adds createFromClosure() and delegates first/isEmpty/last to the pipeline.
src/Collectible.php Updates public API docs to include createFromClosure() + adds complexity annotations.
README.md Adds evaluation strategies section, updates creation examples, and includes complexity tables.
.github/copilot-instructions.md Adds repo-specific Copilot guidance file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Models/Shipments.php
Comment thread src/Collectible.php
Comment thread src/Internal/Pipeline.php
Comment thread README.md
Comment thread README.md
@gustavofreze gustavofreze merged commit 9e810a8 into main Apr 16, 2026
10 checks passed
@gustavofreze gustavofreze deleted the feature/develop branch April 16, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants