Skip to content

Commit 3a68951

Browse files
committed
chore: refactor provider validation method
Signed-off-by: tmakinde <[email protected]>
1 parent a5d35fc commit 3a68951

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/implementation/multiprovider/Multiprovider.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,18 +296,14 @@ private function createErrorResolution(string $flagKey, mixed $defaultValue, ?ar
296296
*/
297297
private function validateProviderData(array $providerData): void
298298
{
299-
foreach ($providerData as $index => $entry) {
299+
foreach ($providerData as $entry) {
300300
// check that entry contains only supported keys
301301
$unSupportedKeys = array_diff(array_keys($entry), self::$supportedProviderData);
302302
if (count($unSupportedKeys) !== 0) {
303-
throw new InvalidArgumentException(
304-
'Unsupported keys in provider data entry at index ' . $index . ': ' . implode(', ', $unSupportedKeys),
305-
);
303+
throw new InvalidArgumentException('Unsupported keys in provider data entry');
306304
}
307305
if (isset($entry['name']) && trim($entry['name']) === '') {
308-
throw new InvalidArgumentException(
309-
'Each provider data entry must have a non-empty string "name" key at index ' . $index,
310-
);
306+
throw new InvalidArgumentException('Each provider data entry must have a non-empty string "name" key');
311307
}
312308
}
313309

0 commit comments

Comments
 (0)