mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -170,6 +170,7 @@ class QueryBuilderFilter implements \JsonSerializable
|
||||
*
|
||||
* @since 5.4.0
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize()
|
||||
{
|
||||
$filter = $this->filter;
|
||||
|
@@ -467,6 +467,7 @@ class QueryBuilderParser implements \JsonSerializable
|
||||
*
|
||||
* @since 5.4.0
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize()
|
||||
{
|
||||
return $this->builder;
|
||||
|
@@ -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()
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user