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

Improve containers types to use iterable objects #299

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Fix text
  • Loading branch information
xepozz committed Apr 20, 2022
commit a06b5ca8aea428d48069604e7a6466be437867c9
4 changes: 2 additions & 2 deletions src/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ private function validateDefinitionTags($tags): void
if (!is_iterable($tags)) {
throw new InvalidConfigException(
sprintf(
'Invalid definition: tags should be iterable object or array of strings, %s given.',
'Invalid definition: tags should be either iterable or array of strings, %s given.',
$this->getVariableType($tags)
)
);
Expand Down Expand Up @@ -414,7 +414,7 @@ private function setTags(iterable $tags): void
if (!is_iterable($services)) {
throw new InvalidConfigException(
sprintf(
'Invalid tags configuration: tag should be iterable object or array of service IDs, %s given.',
'Invalid tags configuration: tag should be either iterable or array of service IDs, %s given.',
$this->getVariableType($services)
)
);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1795,7 +1795,7 @@ public function testNonArrayTags(): void

$this->expectException(InvalidConfigException::class);
$this->expectExceptionMessage(
'Invalid definition: tags should be iterable object or array of strings, integer given.'
'Invalid definition: tags should be either iterable or array of strings, integer given.'
);
new Container($config);
}
Expand All @@ -1808,7 +1808,7 @@ public function dataInvalidTags(): array
[42 => [EngineMarkTwo::class]],
],
[
'Invalid tags configuration: tag should be iterable object or array of service IDs, integer given.',
'Invalid tags configuration: tag should be either iterable or array of service IDs, integer given.',
['engine' => 42],
],
[
Expand Down