From 45431170b629908b9fc39d19a87cf64d90bc9faf Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Nov 2021 17:31:13 +0300 Subject: [PATCH] fix phpstan warnings in classes/db/migrations.php --- classes/db/migrations.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/db/migrations.php b/classes/db/migrations.php index 6e20ddf7f..aecd9186c 100644 --- a/classes/db/migrations.php +++ b/classes/db/migrations.php @@ -21,10 +21,10 @@ class Db_Migrations { private $pdo; /** @var int */ - private $cached_version; + private $cached_version = 0; /** @var int */ - private $cached_max_version; + private $cached_max_version = 0; /** @var int */ private $max_version_override; @@ -65,7 +65,7 @@ class Db_Migrations { } function get_version() : int { - if (isset($this->cached_version)) + if ($this->cached_version) return $this->cached_version; try { @@ -152,7 +152,7 @@ class Db_Migrations { if ($this->max_version_override > 0) return $this->max_version_override; - if (isset($this->cached_max_version)) + if ($this->cached_max_version) return $this->cached_max_version; $migrations = glob("{$this->migrations_path}/*.sql");