Silence return type mismatch (#14298)

* Silence return type mismatch

To keep PHP7 compatibility

* Update QueryBuilderFilter.php

* Update DynamicConfigItem.php

* Update ObjectCache.php

* Update DynamicConfigItem.php
This commit is contained in:
Jellyfrog
2022-09-05 23:19:39 +02:00
committed by GitHub
parent 93572cd5d3
commit 2264229b8b
4 changed files with 16 additions and 16 deletions

View File

@@ -170,6 +170,7 @@ class QueryBuilderFilter implements \JsonSerializable
*
* @since 5.4.0
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$filter = $this->filter;

View File

@@ -467,6 +467,7 @@ class QueryBuilderParser implements \JsonSerializable
*
* @since 5.4.0
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->builder;

View File

@@ -70,10 +70,10 @@ class ObjectCache implements ArrayAccess
/**
* Check if data exists
*
* @param string $obj Name of Data-Object
* @param mixed $obj Name of Data-Object
* @return bool
*/
public function offsetExists($obj)
public function offsetExists($obj): bool
{
if (isset($this->data[$obj])) {
return true;
@@ -87,9 +87,10 @@ class ObjectCache implements ArrayAccess
/**
* Get Data-Object
*
* @param string $obj Name of Data-Object
* @param mixed $obj Name of Data-Object
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($obj)
{
if (isset($this->data[$obj])) {
@@ -113,19 +114,17 @@ class ObjectCache implements ArrayAccess
/**
* Overrides internal Cache-Object
*
* @param string $obj Name of Data-Object
* @param mixed $obj Name of Data-Object
* @param mixed $value Value
* @return bool
* @return void
*/
public function offsetSet($obj, $value)
public function offsetSet($obj, $value): void
{
if (! isset($this->data[$obj])) {
$this->data[$obj] = [];
}
$this->data[$obj]['value'] = $value;
return $this->data[$obj]['value'];
}
//end offsetSet()
@@ -133,14 +132,12 @@ class ObjectCache implements ArrayAccess
/**
* Reset Data-Object
*
* @param string $obj Name of Data-Object
* @return mixed
* @param mixed $obj Name of Data-Object
* @return void
*/
public function offsetUnset($obj)
public function offsetUnset($obj): void
{
unset($this->data[$obj]['value']);
return true;
}
//end offsetUnset()

View File

@@ -219,22 +219,23 @@ class DynamicConfigItem implements \ArrayAccess
}
// ArrayAccess functions
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return isset($this->$offset);
}
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->$offset) ? $this->$offset : null;
}
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
$this->$offset = $value;
}
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
unset($this->$offset);
}