Skip to content

Conversation

@clue
Copy link
Owner

@clue clue commented Dec 27, 2025

This changeset refactors and simplifies the App with a new Container::getObject() helper. This is only used internally at the moment, but may be exposed as part of our public API in a follow-up. This also avoids a number of redundant tests and allows us to reuse this logic for more classes in a follow-up.

Builds on top of #284, #274 #175 and others

@clue clue added this to the v0.18.0 milestone Dec 27, 2025
@clue clue requested a review from Copilot December 27, 2025 14:44
@clue clue added maintenance new feature New feature or request labels Dec 27, 2025
Copy link

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

This PR refactors the App and Container classes to use a new generic Container::getObject() helper method instead of the specific getAccessLogHandler() and getErrorHandler() methods. This simplification reduces code duplication and makes the codebase more maintainable by consolidating object loading logic into a single reusable method.

Key changes:

  • Introduced a new generic Container::getObject() method that can load any object type from the container
  • Removed the redundant getAccessLogHandler() and getErrorHandler() methods from Container
  • Updated App to use the new getObject() method for loading handler instances
  • Consolidated test coverage by removing duplicate tests and testing the generic method instead

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/Container.php Adds new getObject() method that generalizes object loading; removes specific getAccessLogHandler() and getErrorHandler() methods
src/App.php Updates constructor to use Container::getObject() instead of specific handler getter methods
tests/ContainerTest.php Refactors tests to use getObject() method; removes redundant ErrorHandler-specific tests; adds new test cases for interface instantiation error handling
tests/AppTest.php Updates mock expectations to use getObject() instead of getAccessLogHandler() and getErrorHandler()

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

@clue clue merged commit e85f185 into clue:main Dec 27, 2025
74 checks passed
@clue clue deleted the container-getobject branch December 27, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant