Skip to content

Commit 1ff942b

Browse files
committed
Fix type errors in key updating logic
1 parent b0a110f commit 1ff942b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Composer/Command/SelfUpdateCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ protected function fetchKeys(IOInterface $io, Config $config): void
369369
$io->write('Open <info>https://composer.github.io/pubkeys.html</info> to find the latest keys');
370370

371371
$validator = static function ($value): string {
372+
$value = (string) $value;
372373
if (!Preg::isMatch('{^-----BEGIN PUBLIC KEY-----$}', trim($value))) {
373374
throw new \UnexpectedValueException('Invalid input');
374375
}
@@ -379,7 +380,7 @@ protected function fetchKeys(IOInterface $io, Config $config): void
379380
$devKey = '';
380381
while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $devKey, $match)) {
381382
$devKey = $io->askAndValidate('Enter Dev / Snapshot Public Key (including lines with -----): ', $validator);
382-
while ($line = $io->ask('')) {
383+
while ($line = $io->ask('', '')) {
383384
$devKey .= trim($line)."\n";
384385
if (trim($line) === '-----END PUBLIC KEY-----') {
385386
break;
@@ -392,7 +393,7 @@ protected function fetchKeys(IOInterface $io, Config $config): void
392393
$tagsKey = '';
393394
while (!Preg::isMatch('{(-----BEGIN PUBLIC KEY-----.+?-----END PUBLIC KEY-----)}s', $tagsKey, $match)) {
394395
$tagsKey = $io->askAndValidate('Enter Tags Public Key (including lines with -----): ', $validator);
395-
while ($line = $io->ask('')) {
396+
while ($line = $io->ask('', '')) {
396397
$tagsKey .= trim($line)."\n";
397398
if (trim($line) === '-----END PUBLIC KEY-----') {
398399
break;

0 commit comments

Comments
 (0)