1
0
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:
Alvaro Flaño
2019-03-27 13:02:40 -03:00
committed by GitHub
parent ebb804e432
commit 93eca5639d

View File

@@ -375,4 +375,14 @@ class NormalizerFormatter implements FormatterInterface
return $date->format($this->dateFormat);
}
protected function addJsonEncodeOption($option)
{
$this->jsonEncodeOptions |= $option;
}
protected function removeJsonEncodeOption($option)
{
$this->jsonEncodeOptions ^= $option;
}
}