1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-25 02:31:25 +02:00

Add #[ReturnTypeWillChange] attribute to suppress deprecation warning… (#481)

* Add #[ReturnTypeWillChange] attribute to suppress deprecation warnings and fatal error

Error occurs on php 7.4 >=

* Same in other 4 methods #[\ReturnTypeWillChange]

Add #[\ReturnTypeWillChange] in other 4 methods to avoid E_DEPRECATED or E_FATAL (php 7.4 >=)
This commit is contained in:
Reinaldo Deprera
2021-10-19 09:33:27 -03:00
committed by GitHub
parent 3541f09f09
commit e8ac3499af

View File

@@ -471,21 +471,25 @@ class DebugBar implements ArrayAccess
// --------------------------------------------
// ArrayAccess implementation
#[\ReturnTypeWillChange]
public function offsetSet($key, $value)
{
throw new DebugBarException("DebugBar[] is read-only");
}
#[\ReturnTypeWillChange]
public function offsetGet($key)
{
return $this->getCollector($key);
}
#[\ReturnTypeWillChange]
public function offsetExists($key)
{
return $this->hasCollector($key);
}
#[\ReturnTypeWillChange]
public function offsetUnset($key)
{
throw new DebugBarException("DebugBar[] is read-only");