function Git::getAuthenticationFailure
Return value
array<int, string>|null
1 call to Git::getAuthenticationFailure()
- Git::runCommand in vendor/
composer/ composer/ src/ Composer/ Util/ Git.php
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Git.php, line 477
Class
- Git
- @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\UtilCode
private function getAuthenticationFailure(string $url) : ?array {
if (!Preg::isMatchStrictGroups('{^(https?://)([^/]+)(.*)$}i', $url, $match)) {
return null;
}
$authFailures = [
'fatal: Authentication failed',
'remote error: Invalid username or password.',
'error: 401 Unauthorized',
'fatal: unable to access',
'fatal: could not read Username',
];
$errorOutput = $this->process
->getErrorOutput();
foreach ($authFailures as $authFailure) {
if (strpos($errorOutput, $authFailure) !== false) {
return $match;
}
}
return null;
}