[PHP8.1] Added some fixes for PHP 8.1

This commit is contained in:
Andreas
2022-12-14 12:48:56 +01:00
parent 7043561f18
commit 8384d7d421
3 changed files with 11 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $name Session cookie name
* @return bool
*/
public function open($save_path, $name)
public function open($save_path, $name): bool
{
if ( ! is_dir($save_path))
{
@@ -165,6 +165,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_id Session ID
* @return string Serialized session data
*/
#[\ReturnTypeWillChange]
public function read($session_id)
{
// This might seem weird, but PHP 5.6 introduces session_reset(),
@@ -238,6 +239,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_data Serialized session data
* @return bool
*/
#[\ReturnTypeWillChange]
public function write($session_id, $session_data)
{
// If the two IDs don't match, we have a session_regenerate_id() call
@@ -295,6 +297,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function close()
{
if (is_resource($this->_file_handle))
@@ -318,6 +321,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param string $session_id Session ID
* @return bool
*/
#[\ReturnTypeWillChange]
public function destroy($session_id)
{
if ($this->close() === $this->_success)
@@ -359,6 +363,7 @@ class CI_Session_files_driver extends CI_Session_driver implements SessionHandle
* @param int $maxlifetime Maximum lifetime of sessions
* @return bool
*/
#[\ReturnTypeWillChange]
public function gc($maxlifetime)
{
if ( ! is_dir($this->_config['save_path']) OR ($directory = opendir($this->_config['save_path'])) === FALSE)