Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[!!!][FEATURE] Use dependency injection where possible #99

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

eliashaeussler
Copy link
Owner

This PR rewrites a bunch of classes to allow constructor injection using the service container. Since several classes are also used on a very low level, some of them are still instantiated by without the service container. In addition, solution providers and prompts are now forced to implement a create() factory method.

@eliashaeussler eliashaeussler added enhancement New feature or request breaking This introduces a breaking change labels Apr 11, 2023
@eliashaeussler eliashaeussler self-assigned this Apr 11, 2023
@codeclimate
Copy link

codeclimate bot commented Apr 11, 2023

Code Climate has analyzed commit 0384bb6 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 84.7% (50% is the threshold).

This pull request will bring the total coverage in the repository to 87.5% (1.4% change).

View more on Code Climate.

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Patch coverage: 84.78% and project coverage change: +1.40 🎉

Comparison is base (b39f7cc) 86.17% compared to head (0384bb6) 87.58%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main      #99      +/-   ##
============================================
+ Coverage     86.17%   87.58%   +1.40%     
- Complexity      244      255      +11     
============================================
  Files            39       41       +2     
  Lines           890      910      +20     
============================================
+ Hits            767      797      +30     
+ Misses          123      113      -10     
Impacted Files Coverage Δ
Classes/Error/AiSolverExceptionHandler.php 0.00% <0.00%> (ø)
Classes/Middleware/SolutionMiddleware.php 60.00% <0.00%> (ø)
Classes/Command/ListModelsCommand.php 100.00% <100.00%> (+100.00%) ⬆️
Classes/Command/SolveCommand.php 100.00% <100.00%> (ø)
Classes/Configuration/Configuration.php 100.00% <100.00%> (ø)
...ses/Exception/MissingSolutionProviderException.php 100.00% <100.00%> (ø)
Classes/Formatter/CliFormatter.php 100.00% <100.00%> (ø)
Classes/Formatter/Message/ExceptionFormatter.php 100.00% <100.00%> (ø)
...ses/Formatter/Message/ExceptionStreamFormatter.php 100.00% <100.00%> (ø)
Classes/Formatter/WebFormatter.php 100.00% <100.00%> (+5.55%) ⬆️
... and 7 more

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eliashaeussler eliashaeussler force-pushed the feature/di branch 4 times, most recently from 3575a10 to 0a606f9 Compare April 11, 2023 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This introduces a breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant