function SvnDriver::getChangeDate
@inheritDoc
Overrides VcsDriverInterface::getChangeDate
File
-
vendor/
composer/ composer/ src/ Composer/ Repository/ Vcs/ SvnDriver.php, line 204
Class
- SvnDriver
- @author Jordi Boggiano <j.boggiano@seld.be> @author Till Klampaeckel <till@php.net>
Namespace
Composer\Repository\VcsCode
public function getChangeDate(string $identifier) : ?\DateTimeImmutable {
$identifier = '/' . trim($identifier, '/') . '/';
if (Preg::isMatch('{^(.+?)(@\\d+)?/$}', $identifier, $match) && null !== $match[2]) {
$path = $match[1];
$rev = $match[2];
}
else {
$path = $identifier;
$rev = '';
}
$output = $this->execute([
'svn',
'info',
], $this->baseUrl . $path . $rev);
foreach ($this->process
->splitLines($output) as $line) {
if ($line !== '' && Preg::isMatchStrictGroups('{^Last Changed Date: ([^(]+)}', $line, $match)) {
return new \DateTimeImmutable($match[1], new \DateTimeZone('UTC'));
}
}
return null;
}