diff --git a/lib/AtomFeed.php b/lib/AtomFeed.php index d8f457e8..28d2845f 100644 --- a/lib/AtomFeed.php +++ b/lib/AtomFeed.php @@ -55,7 +55,7 @@ class AtomFeed extends Feed{ $currentEntries = []; foreach($this->Entries as $entry){ $obj = new StdClass(); - if(is_a($entry, 'Ebook')){ + if($entry instanceof Ebook){ $obj->Updated = $entry->Updated->format('Y-m-d\TH:i:s\Z'); $obj->Id = SITE_URL . $entry->Url; } diff --git a/lib/DbConnection.php b/lib/DbConnection.php index 393dcb99..1c4fd68e 100644 --- a/lib/DbConnection.php +++ b/lib/DbConnection.php @@ -93,7 +93,7 @@ class DbConnection{ foreach($params as $parameter){ $name++; - if(is_a($parameter, 'DateTime') || is_a($parameter, 'DateTimeImmutable')){ + if($parameter instanceof DateTimeInterface){ $parameter = $parameter->format('Y-m-d H:i:s'); } elseif(is_bool($parameter)){ diff --git a/lib/OpdsFeed.php b/lib/OpdsFeed.php index d30ab1b7..ffa9012d 100644 --- a/lib/OpdsFeed.php +++ b/lib/OpdsFeed.php @@ -27,7 +27,7 @@ class OpdsFeed extends AtomFeed{ protected function SaveUpdated(string $entryId, DateTime $updated): void{ // Only save the updated timestamp for the given entry ID in this file foreach($this->Entries as $entry){ - if(is_a($entry, 'OpdsNavigationEntry')){ + if($entry instanceof OpdsNavigationEntry){ if($entry->Id == SITE_URL . $entryId){ $entry->Updated = $updated; } diff --git a/www/sessions/new.php b/www/sessions/new.php index e3b826db..7096101f 100644 --- a/www/sessions/new.php +++ b/www/sessions/new.php @@ -17,7 +17,7 @@ $passwordRequired = false; http_response_code(401); if($exception){ - if(is_a($exception, 'Exceptions\PasswordRequiredException')){ + if($exception instanceof Exceptions\PasswordRequiredException){ // This login requires a password to proceed. // Prompt the user for a password. http_response_code(401);