From 49135aefab02730fccf8ead3788c34d055ba528a Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 26 Sep 2020 11:22:57 +0200 Subject: [PATCH] fix DateTimeImmutable typehint --- Stdlib/Graph/Node.php | 6 +++--- System/File/Ftp/FileAbstract.php | 2 +- System/File/Local/FileAbstract.php | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Stdlib/Graph/Node.php b/Stdlib/Graph/Node.php index 069c47b88..ac681bc8a 100644 --- a/Stdlib/Graph/Node.php +++ b/Stdlib/Graph/Node.php @@ -117,9 +117,9 @@ class Node /** * Set a relative undirected node. * - * @param Node $node Graph node - * @param int $key Index for absolute position - * @param booll $isDirected Is directed + * @param Node $node Graph node + * @param int $key Index for absolute position + * @param bool $isDirected Is directed * * @return Edge * diff --git a/System/File/Ftp/FileAbstract.php b/System/File/Ftp/FileAbstract.php index f073770f2..e82348366 100644 --- a/System/File/Ftp/FileAbstract.php +++ b/System/File/Ftp/FileAbstract.php @@ -63,7 +63,7 @@ abstract class FileAbstract implements ContainerInterface /** * Created at. * - * @var \DateTime + * @var \DateTimeImmutable * @since 1.0.0 */ protected \DateTimeImmutable $createdAt; diff --git a/System/File/Local/FileAbstract.php b/System/File/Local/FileAbstract.php index 3cb1a51d3..782351c33 100644 --- a/System/File/Local/FileAbstract.php +++ b/System/File/Local/FileAbstract.php @@ -63,7 +63,7 @@ abstract class FileAbstract implements ContainerInterface /** * Created at. * - * @var \DateTime + * @var \DateTimeImmutable * @since 1.0.0 */ protected \DateTimeImmutable $createdAt; @@ -188,8 +188,8 @@ abstract class FileAbstract implements ContainerInterface $mtime = \filemtime($this->path); $ctime = \filectime($this->path); - $this->createdAt->setTimestamp($mtime === false ? 0 : $mtime); - $this->changedAt->setTimestamp($ctime === false ? 0 : $ctime); + $this->createdAt = (new \DateTimeImmutable())->setTimestamp($mtime === false ? 0 : $mtime); + $this->changedAt = (new \DateTimeImmutable())->setTimestamp($ctime === false ? 0 : $ctime); $owner = \fileowner($this->path);