function RemoteFilesystem::findStatusMessage
Parameters
string[] $headers array of returned headers like from getLastHeaders():
Return value
string|null
1 call to RemoteFilesystem::findStatusMessage()
- RemoteFilesystem::get in vendor/
composer/ composer/ src/ Composer/ Util/ RemoteFilesystem.php - Get file content or copy action.
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ RemoteFilesystem.php, line 188
Class
- RemoteFilesystem
- @internal @author François Pluchino <francois.pluchino@opendisplay.com> @author Jordi Boggiano <j.boggiano@seld.be> @author Nils Adermann <naderman@naderman.de>
Namespace
Composer\UtilCode
public function findStatusMessage(array $headers) {
$value = null;
foreach ($headers as $header) {
if (Preg::isMatch('{^HTTP/\\S+ \\d+}i', $header)) {
// In case of redirects, http_response_headers contains the headers of all responses
// so we can not return directly and need to keep iterating
$value = $header;
}
}
return $value;
}