Skip to content

Commit 0f4d026

Browse files
authored
Fix type error (#898)
The profile name seems to be cast to an integer if it looks like an integer. That's the case for example with a `7777` profile, I got the following error: ``` PHP Fatal error: Uncaught TypeError: preg_replace(): Argument #3 ($subject) must be of type array|string, int given in .../vendor/async-aws/core/src/Credentials/IniFileLoader.php:56 Stack trace: #0 .../vendor/async-aws/core/src/Credentials/IniFileLoader.php(56): preg_replace('/^profile /', '', 7777) ```
1 parent bc54526 commit 0f4d026

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Credentials/IniFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function loadProfiles(array $filepaths): array
5353
}
5454

5555
foreach ($this->parseIniFile($filepath) as $name => $profile) {
56-
$name = \preg_replace('/^profile /', '', $name);
56+
$name = \preg_replace('/^profile /', '', (string) $name);
5757
if (!isset($profilesData[$name])) {
5858
$profilesData[$name] = \array_map('trim', $profile);
5959
} else {

0 commit comments

Comments
 (0)