diff --git a/src/Checks/PlausiForLegalStatus/MDPlausiForLegalStatus.php b/src/Checks/PlausiForLegalStatus/MDPlausiForLegalStatus.php index 0b8da27..49f9d5c 100644 --- a/src/Checks/PlausiForLegalStatus/MDPlausiForLegalStatus.php +++ b/src/Checks/PlausiForLegalStatus/MDPlausiForLegalStatus.php @@ -49,16 +49,17 @@ final class MDPlausiForLegalStatus { private function _determineExpectedStatus():string { $currentYear = (int)date("Y"); + $deathYearOfLastCreator = (int)date("Y", $this->_death_of_last_creator); - if (!isset($this->_death_of_last_creator)) { + if (!isset($deathYearOfLastCreator)) { return 'any'; } - if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN > $this->_death_of_last_creator) { + if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN > $deathYearOfLastCreator) { return 'pd'; } - if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN_CERTAIN < $this->_death_of_last_creator) { + if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN_CERTAIN < $deathYearOfLastCreator) { return 'restricted'; }