From ca00987fb2bcecb5f7831d9965eebf7c382480d8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 7 Oct 2021 18:39:40 +0200 Subject: [PATCH] fix PHP 8.0 Fatal error: Declaration of Api\Etemplate\Request\Session::read($id = null) must be compatible with Api\Etemplate\Request::read($id = null, $handle_not_found = true) --- api/src/Etemplate/Request/Files.php | 5 +++-- api/src/Etemplate/Request/Session.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/src/Etemplate/Request/Files.php b/api/src/Etemplate/Request/Files.php index b15054d320..613bd5be30 100644 --- a/api/src/Etemplate/Request/Files.php +++ b/api/src/Etemplate/Request/Files.php @@ -97,9 +97,10 @@ class Files extends Etemplate\Request * Factory method to get a new request object or the one for an existing request * * @param string $id =null - * @return ?Etemplate\Request|false the object or false if $id is not found + * @param bool $handle_not_found =true true: handle not found by trying to redirect, false: just return null + * @return Request|null null if Request not found and $handle_not_found === false */ - static function read($id=null) + public static function read($id=null, $handle_not_found=true) { $request = new Files($id); diff --git a/api/src/Etemplate/Request/Session.php b/api/src/Etemplate/Request/Session.php index 7bad1420fe..339c09307d 100644 --- a/api/src/Etemplate/Request/Session.php +++ b/api/src/Etemplate/Request/Session.php @@ -83,9 +83,10 @@ class Session extends Etemplate\Request * Factory method to get a new request object or the one for an existing request * * @param string $id =null - * @return ?Etemplate\request|false the object or false if $id is not found + * @param bool $handle_not_found =true true: handle not found by trying to redirect, false: just return null + * @return Request|null null if Request not found and $handle_not_found === false */ - static function read($id=null) + public static function read($id=null, $handle_not_found=true) { $request = new Session($id);