Conversation
# Conflicts: # src/Container.php # tests/Unit/ContainerTest.php
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #299 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 158 160 +2
===========================================
Files 11 11
Lines 460 467 +7
===========================================
+ Hits 460 467 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vjik
left a comment
There was a problem hiding this comment.
Overall good. One change is needed to satisfy psalm.
Co-authored-by: Sergei Predvoditelev <[email protected]>
|
@xepozz need a line for CHANGELOG. Also, it looks like BC-breaking change. |
Done. I can keep it for 2.0 |
| return [ | ||
| [ | ||
| '/^Invalid tags configuration: tag should be string, 42 given\.$/', | ||
| 'Invalid tags configuration: tag should be string, array given.', |
There was a problem hiding this comment.
That does not look right. The problem here is 42, right?
| } | ||
| /** @var string $id */ | ||
|
|
||
| $id = (string) $id; |
There was a problem hiding this comment.
Not need type-casting. Above check that $id is string.
| * @throws InvalidConfigException | ||
| */ | ||
| private function validateMeta(array $meta): void | ||
| private function validateMeta(iterable $meta): void |
There was a problem hiding this comment.
validateMeta always receive array. Not need iterable.
| /** @var mixed $value */ | ||
| /** @psalm-suppress MixedAssignment */ | ||
| foreach ($meta as $key => $value) { | ||
| $key = (string)$key; |
There was a problem hiding this comment.
| $key = (string)$key; |
Not need.
| } | ||
|
|
||
| $tags = $this->tags[$tag]; | ||
| $tags = $tags instanceof Traversable ? iterator_to_array($tags, true) : $tags; |
There was a problem hiding this comment.
Better convert iterable to array before foreach
| * and a corresponding value is callable doing the job. | ||
| */ | ||
| public function getExtensions(): array; | ||
| public function getExtensions(): iterable; |
| * an interface name), and a corresponding value is a service definition. | ||
| */ | ||
| public function getDefinitions(): array; | ||
| public function getDefinitions(): iterable; |
| sprintf( | ||
| 'Invalid tags configuration: tag should be string, %s given.', | ||
| $tag | ||
| get_debug_type($services) |
There was a problem hiding this comment.
| get_debug_type($services) | |
| get_debug_type($tag) |
Added ability to use iterable parameters.
For example, now you cannot use Generator as tags values.