1
0
Fork 0

Fix deprecation notice (#10921)

Deprecation Notice: trim(): Passing null to parameter #1 ($string) of type string is deprecated in phar:///usr/bin/composer/src/Composer/Util/GitHub.php:103
pull/10985/head
fluffycondor 2022-07-05 16:51:07 +03:00 committed by GitHub
parent 92e1c26c3b
commit 3ebd66b851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -101,9 +101,9 @@ class GitHub
$this->io->writeError(sprintf('Tokens will be stored in plain text in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName())); $this->io->writeError(sprintf('Tokens will be stored in plain text in "%s" for future use by Composer.', $this->config->getAuthConfigSource()->getName()));
$this->io->writeError('For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth'); $this->io->writeError('For additional information, check https://getcomposer.org/doc/articles/authentication-for-private-packages.md#github-oauth');
$token = trim($this->io->askAndHideAnswer('Token (hidden): ')); $token = trim((string) $this->io->askAndHideAnswer('Token (hidden): '));
if (!$token) { if ($token === '') {
$this->io->writeError('<warning>No token given, aborting.</warning>'); $this->io->writeError('<warning>No token given, aborting.</warning>');
$this->io->writeError('You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"'); $this->io->writeError('You can also add it manually later by using "composer config --global --auth github-oauth.github.com <token>"');