psalm-types for complex service/extension/factory type hints. - #46
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #46 +/- ##
=========================================
Coverage 98.97% 98.97%
Complexity 217 217
=========================================
Files 10 10
Lines 588 588
=========================================
Hits 582 582
Misses 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…salm-types-for-services # Conflicts: # src/Container/ContainerConfigurator.php # src/Container/ReadOnlyContainer.php
Chrico
marked this pull request as ready for review
May 10, 2024 08:07
tfrommen
approved these changes
May 10, 2024
Member
There was a problem hiding this comment.
I like adding an actual custom type for these. What I don't personally like that much is that we now have to add a lot of Psalm-specific annotations to the codebase. If possible, things like that were much better kept in or handled via the config, but this doesn't seem to be possible (nor planned).
Thanks for this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This PR does introduce 2 new
psalm-typesfor:callable(ContainerInterface $container):mixedcallable(mixed $service, ContainerInterface $container):mixedand centrailizes the definition to reuse it in
ReadOnlyContainerandContainerConfigurator