Skip to content

Commit

Permalink
Add #[ReturnTypeWillChange] attribute to suppress deprecation warning… (
Browse files Browse the repository at this point in the history
#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 >=)
  • Loading branch information
rdeprera authored Oct 19, 2021
1 parent 3541f09 commit e8ac349
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/DebugBar/DebugBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,21 +471,25 @@ public function getJavascriptRenderer($baseUrl = null, $basePath = null)
// --------------------------------------------
// 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");
Expand Down

0 comments on commit e8ac349

Please sign in to comment.