Skip to content

Commit

Permalink
Fixed compatibility with PHP 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Nov 11, 2020
1 parent 1681432 commit 98b5509
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Command/FixerApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ private function downloadPhar(
/** @var array{version: string, date: string} $currentInfo */
$currentInfo = Json::decode(FileReader::read($infoPath), Json::FORCE_ARRAY);
$currentVersion = $currentInfo['version'];
$currentDate = \DateTimeImmutable::createFromFormat(\DateTimeImmutable::ATOM, $currentInfo['date']);
$currentDate = \DateTime::createFromFormat(\DateTime::ATOM, $currentInfo['date']);
if ($currentDate === false) {
throw new \PHPStan\ShouldNotHappenException();
}
Expand Down Expand Up @@ -434,7 +434,7 @@ private function writeInfoFile(string $infoPath, string $version): void
{
FileWriter::write($infoPath, Json::encode([
'version' => $version,
'date' => (new \DateTimeImmutable('', new \DateTimeZone('UTC')))->format(\DateTimeImmutable::ATOM),
'date' => (new \DateTimeImmutable('', new \DateTimeZone('UTC')))->format(\DateTime::ATOM),
]));
}

Expand Down

0 comments on commit 98b5509

Please sign in to comment.