mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 05:07:36 +02:00
Enable adding/removing options to json_encode()
Sometimes you want to add some options. In my case I wanted to encode the data using JSON_FORCE_OBJECT, but there was no way to do it
This commit is contained in:
@@ -375,4 +375,14 @@ class NormalizerFormatter implements FormatterInterface
|
|||||||
|
|
||||||
return $date->format($this->dateFormat);
|
return $date->format($this->dateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function addJsonEncodeOption($option)
|
||||||
|
{
|
||||||
|
$this->jsonEncodeOptions |= $option;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function removeJsonEncodeOption($option)
|
||||||
|
{
|
||||||
|
$this->jsonEncodeOptions ^= $option;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user