Reverted some changes that won't work with PHP7.3

This commit is contained in:
Thorsten 2022-11-18 19:41:56 +01:00
parent 7a39be8270
commit 2edbd1a3e2
7 changed files with 14 additions and 17 deletions

View file

@ -130,7 +130,7 @@ class Page implements ArrayAccess
* The return value will be casted to boolean if non-boolean was returned. * The return value will be casted to boolean if non-boolean was returned.
* @since 5.0.0 * @since 5.0.0
*/ */
public function offsetExists(mixed $offset): bool public function offsetExists($offset): bool
{ {
return isset($this->page[$offset]); return isset($this->page[$offset]);
} }
@ -147,7 +147,7 @@ class Page implements ArrayAccess
* @return mixed Can return all value types. * @return mixed Can return all value types.
* @since 5.0.0 * @since 5.0.0
*/ */
public function offsetGet(mixed $offset): mixed public function offsetGet($offset)
{ {
return $this->page[$offset] ?? null; return $this->page[$offset] ?? null;
} }
@ -167,7 +167,7 @@ class Page implements ArrayAccess
* @return void * @return void
* @since 5.0.0 * @since 5.0.0
*/ */
public function offsetSet(mixed $offset, mixed $value): void public function offsetSet($offset, $value)
{ {
$this->page[$offset] = $value; $this->page[$offset] = $value;
} }
@ -184,7 +184,7 @@ class Page implements ArrayAccess
* @return void * @return void
* @since 5.0.0 * @since 5.0.0
*/ */
public function offsetUnset(mixed $offset): void public function offsetUnset($offset)
{ {
if (isset($this->page[$offset])) { if (isset($this->page[$offset])) {
unset($this->page[$offset]); unset($this->page[$offset]);

View file

@ -48,7 +48,7 @@ class BaseCollection extends \ArrayIterator
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function offsetSet(mixed $offset, mixed $value): void public function offsetSet($offset, $value)
{ {
if (is_null($offset)) { if (is_null($offset)) {
$this->totalCount++; $this->totalCount++;
@ -60,7 +60,7 @@ class BaseCollection extends \ArrayIterator
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function offsetUnset(mixed $offset): void public function offsetUnset($offset)
{ {
if ($this->offsetExists($offset)) { if ($this->offsetExists($offset)) {
$this->totalCount--; $this->totalCount--;

View file

@ -794,10 +794,7 @@ class Conversation
return []; return [];
} }
$blocked = $this->pConfig->get($this->session->getLocalUserId(), 'system', 'blocked'); $str_blocked = str_replace(["\n", "\r"], ",", $this->pConfig->get($this->session->getLocalUserId(), 'system', 'blocked'));
if (!empty($blocked)) {
$str_blocked = str_replace(["\n", "\r"], ",", $blocked);
}
if (empty($str_blocked)) { if (empty($str_blocked)) {
return []; return [];
} }

View file

@ -245,7 +245,7 @@ class Nav
$gdirpath = 'directory'; $gdirpath = 'directory';
if (empty(DI::config()->get('system', 'singleuser'))) { if (strlen(DI::config()->get('system', 'singleuser'))) {
$gdir = DI::config()->get('system', 'directory'); $gdir = DI::config()->get('system', 'directory');
if (strlen($gdir)) { if (strlen($gdir)) {
$gdirpath = Profile::zrl($gdir, true); $gdirpath = Profile::zrl($gdir, true);

View file

@ -57,7 +57,7 @@ class Database extends AbstractSessionHandler
return true; return true;
} }
public function read($id): string|false public function read($id)
{ {
if (empty($id)) { if (empty($id)) {
return ''; return '';
@ -136,7 +136,7 @@ class Database extends AbstractSessionHandler
} }
} }
public function gc($max_lifetime): int|false public function gc($max_lifetime): bool
{ {
try { try {
return $this->dba->delete('session', ["`expire` < ?", time()]); return $this->dba->delete('session', ["`expire` < ?", time()]);

View file

@ -117,7 +117,7 @@ class Database
$port = trim($serverdata[1]); $port = trim($serverdata[1]);
} }
if (!empty(trim((string) $this->configCache->get('database', 'port')))) { if (!empty(trim($this->configCache->get('database', 'port')))) {
$port = trim($this->configCache->get('database', 'port')); $port = trim($this->configCache->get('database', 'port'));
} }

View file

@ -160,7 +160,7 @@ class ParsedLogIterator implements \Iterator
* @see Iterator::next() * @see Iterator::next()
* @return void * @return void
*/ */
public function next(): void public function next()
{ {
$parsed = $this->read(); $parsed = $this->read();
@ -177,7 +177,7 @@ class ParsedLogIterator implements \Iterator
* @see Iterator::rewind() * @see Iterator::rewind()
* @return void * @return void
*/ */
public function rewind(): void public function rewind()
{ {
$this->value = null; $this->value = null;
$this->reader->rewind(); $this->reader->rewind();
@ -202,7 +202,7 @@ class ParsedLogIterator implements \Iterator
* @see Iterator::current() * @see Iterator::current()
* @return ?ParsedLogLing * @return ?ParsedLogLing
*/ */
public function current(): mixed public function current()
{ {
return $this->value; return $this->value;
} }