Skip to content

Commit

Permalink
qa: rename assertion method and its argument to reflect actual assertion
Browse files Browse the repository at this point in the history
Signed-off-by: Maximilian Bösing <[email protected]>
  • Loading branch information
boesing committed Jan 17, 2024
1 parent cbc1dad commit 8b580e5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/Service/ConfigProviderIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public function servicesProvidedByConfigProvider(): Generator
$dependencies = $provider->getDependencyConfig();

$factories = $dependencies['factories'] ?? [];
self::assertMappedWithStrings($factories);
self::assertArrayIsMappedWithStrings($factories);
$invokables = $dependencies['invokables'] ?? [];
self::assertMappedWithStrings($invokables);
self::assertArrayIsMappedWithStrings($invokables);
$services = $dependencies['services'] ?? [];
self::assertMappedWithStrings($services);
self::assertArrayIsMappedWithStrings($services);
$aliases = $dependencies['aliases'] ?? [];
self::assertMappedWithStrings($aliases);
self::assertArrayIsMappedWithStrings($aliases);

$serviceNames = array_unique(
array_merge(
Expand All @@ -73,15 +73,15 @@ public function servicesProvidedByConfigProvider(): Generator
}

/**
* @psalm-assert array<string,mixed> $iterable
* @psalm-assert array<string,mixed> $array
*/
private static function assertMappedWithStrings(mixed $iterable): void
private static function assertArrayIsMappedWithStrings(mixed $array): void
{
if (! is_array($iterable)) {
if (! is_array($array)) {
throw new InvalidArgumentException('Expecting value to be an array.');
}

foreach (array_keys($iterable) as $value) {
foreach (array_keys($array) as $value) {
if (is_string($value)) {
continue;
}
Expand Down

0 comments on commit 8b580e5

Please sign in to comment.