mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-02 19:27:37 +02:00
Expand code a bit
This commit is contained in:
@@ -76,13 +76,16 @@ class LogRecord implements ArrayAccess
|
|||||||
|
|
||||||
public function &offsetGet(mixed $offset): mixed
|
public function &offsetGet(mixed $offset): mixed
|
||||||
{
|
{
|
||||||
if ($offset === 'level_name' || $offset === 'level') {
|
// handle special cases for the level enum
|
||||||
|
if ($offset === 'level_name') {
|
||||||
// avoid returning readonly props by ref as this is illegal
|
// avoid returning readonly props by ref as this is illegal
|
||||||
if ($offset === 'level_name') {
|
$copy = $this->level->getName();
|
||||||
$copy = $this->level->getName();
|
|
||||||
} else {
|
return $copy;
|
||||||
$copy = $this->level->value;
|
}
|
||||||
}
|
if ($offset === 'level') {
|
||||||
|
// avoid returning readonly props by ref as this is illegal
|
||||||
|
$copy = $this->level->value;
|
||||||
|
|
||||||
return $copy;
|
return $copy;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user