Add test for cases of actors dying about 95 years ago (between Berne

convention expiry and max. expiry) and fix early variable access
This commit is contained in:
2023-10-05 20:42:29 +02:00
parent 5d300d02bd
commit 7596d9f18e
2 changed files with 75 additions and 2 deletions

View File

@ -49,12 +49,13 @@ final class MDPlausiForLegalStatus {
private function _determineExpectedStatus():string {
$currentYear = (int)date("Y");
$deathYearOfLastCreator = (int)date("Y", $this->_death_of_last_creator);
if (!isset($deathYearOfLastCreator)) {
if (!isset($this->_death_of_last_creator)) {
return 'any';
}
$deathYearOfLastCreator = (int)date("Y", $this->_death_of_last_creator);
if ($currentYear - self::YEARS_AFTER_DEATH_TO_PUBLIC_DOMAIN > $deathYearOfLastCreator) {
return 'pd';
}