1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[ticket/17535] Fix tests PHP deprecations and notices

PHPBB-17535
This commit is contained in:
rxu
2025-07-18 11:00:58 +07:00
parent 8a99024087
commit 902c99bc0c
36 changed files with 193 additions and 111 deletions

View File

@@ -556,6 +556,7 @@ class compress_tar extends compress
{
var $isgz = false;
var $isbz = false;
var $file = '';
var $filename = '';
var $mode = '';
var $type = '';

View File

@@ -70,11 +70,11 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
/**
* Redirects isset to the correct request class call.
*
* @param string $offset The key of the super global being accessed.
* @param mixed $offset The key of the super global being accessed.
*
* @return bool Whether the key on the super global exists.
*/
public function offsetExists($offset): bool
public function offsetExists(mixed $offset): bool
{
return $this->request->is_set($offset, $this->super_global);
}
@@ -82,17 +82,17 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
/**#@+
* Part of the \ArrayAccess implementation, will always result in a FATAL error.
*/
public function offsetGet($offset): void
#[\ReturnTypeWillChange] public function offsetGet($offset): void
{
$this->error();
}
public function offsetSet($offset, $value): void
#[\ReturnTypeWillChange] public function offsetSet($offset, $value): void
{
$this->error();
}
public function offsetUnset($offset): void
#[\ReturnTypeWillChange] public function offsetUnset($offset): void
{
$this->error();
}

View File

@@ -27,7 +27,7 @@ class user extends \phpbb\session
protected $language;
var $style = array();
var $date_format;
var $date_format = '';
/**
* DateTimeZone object holding the timezone of the user
@@ -627,12 +627,12 @@ class user extends \phpbb\session
* Format user date
*
* @param int $gmepoch unix timestamp
* @param string|false $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
* @param string $format date format in date() notation. | used to indicate relative dates, for example |d m Y|, h:i is translated to Today, h:i.
* @param bool $forcedate force non-relative date format.
*
* @return mixed translated date
*/
function format_date($gmepoch, $format = false, $forcedate = false)
function format_date($gmepoch, $format = '', $forcedate = false)
{
global $phpbb_dispatcher;
static $utc;