some improvements
This commit is contained in:
@@ -33,6 +33,11 @@ class TaskManager
|
||||
*/
|
||||
private $tasks = [];
|
||||
|
||||
/**
|
||||
* @var Serializer
|
||||
*/
|
||||
private $serializer;
|
||||
|
||||
/**
|
||||
* @param Taskwarrior $taskwarrior
|
||||
*/
|
||||
@@ -400,12 +405,16 @@ class TaskManager
|
||||
*/
|
||||
private function getSerializer()
|
||||
{
|
||||
if ($this->serializer) {
|
||||
return $this->serializer;
|
||||
}
|
||||
|
||||
$propertyNamingStrategy = new SerializedNameAnnotationStrategy(new CamelCaseNamingStrategy());
|
||||
|
||||
$visitor = new JsonSerializationVisitor($propertyNamingStrategy);
|
||||
$visitor->setOptions(JSON_UNESCAPED_UNICODE);
|
||||
|
||||
return SerializerBuilder::create()
|
||||
return $this->serializer = SerializerBuilder::create()
|
||||
->setPropertyNamingStrategy($propertyNamingStrategy)
|
||||
->configureHandlers(function (HandlerRegistryInterface $registry) {
|
||||
$registry->registerSubscribingHandler(new CarbonHandler());
|
||||
|
Reference in New Issue
Block a user