Skip to content

Refactor: move filterByMinDuration into TimeEntryCollection and make grouped() return a collection #74

Description

@igancev

Tasks

  • Move WorkReportCommand::filterByMinDuration() logic into TimeEntryCollection as a public, immutable method returning a new TimeEntryCollection.
  • Change TimeEntryCollection::grouped() to return TimeEntryCollection instead of TimeEntry[], keeping it immutable (no mutation of $this->items).
  • Update WorkReportCommand and any other callers to consume the new APIs.
  • Adjust/extend tests to cover the new return types and behavior.

Files

  • src/TimeEntryCollection.php
  • src/Cli/WorkReportCommand.php
  • tests/ — relevant tests for both classes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions