{"action":"closed","issue":{"url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/748","repository_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle","labels_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/748/labels{/name}","comments_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/748/comments","events_url":"https://api.github.com/repos/schmittjoh/JMSSerializerBundle/issues/748/events","html_url":"https://github.com/schmittjoh/JMSSerializerBundle/issues/748","id":447519369,"node_id":"MDU6SXNzdWU0NDc1MTkzNjk=","number":748,"title":"Unable to register custom Handler","user":{"login":"lowki","id":1659775,"node_id":"MDQ6VXNlcjE2NTk3NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1659775?v=4","gravatar_id":"","url":"https://api.github.com/users/lowki","html_url":"https://github.com/lowki","followers_url":"https://api.github.com/users/lowki/followers","following_url":"https://api.github.com/users/lowki/following{/other_user}","gists_url":"https://api.github.com/users/lowki/gists{/gist_id}","starred_url":"https://api.github.com/users/lowki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowki/subscriptions","organizations_url":"https://api.github.com/users/lowki/orgs","repos_url":"https://api.github.com/users/lowki/repos","events_url":"https://api.github.com/users/lowki/events{/privacy}","received_events_url":"https://api.github.com/users/lowki/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-05-23T08:36:30Z","updated_at":"2019-05-23T11:51:26Z","closed_at":"2019-05-23T11:51:26Z","author_association":"NONE","body":"I can't declare a custom Handler service following the [doc](https://jmsyst.com/bundles/JMSSerializerBundle/master/configuration) \r\n\r\nHere's my custom handler class:\r\n````php\r\n<?php\r\nuse JMS\\Serializer\\JsonSerializationVisitor;\r\nuse JMS\\Serializer\\Context;\r\nuse JMS\\Serializer\\Handler\\SubscribingHandlerInterface;\r\n\r\nnamespace AppBundle\\Service;\r\n\r\nclass SerializerHandler implements SubscribingHandlerInterface\r\n{\r\n    public static function getSubscribingMethods()\r\n    {\r\n        return [\r\n            [\r\n                'direction' => GraphNavigator::DIRECTION_SERIALIZATION,\r\n                'format' => 'json',\r\n                'type' => 'integer',\r\n                'method' => 'serializeIntToJson',\r\n            ],\r\n        ];\r\n    }\r\n    \r\n    public function serializeIntToJson(JsonSerializationVisitor $visitor, $int, array $type, Context $context)\r\n    {\r\n        dump($int);\r\n        return $int;\r\n    }\r\n}\r\n````\r\n\r\nAnd my service declaration:\r\n\r\n````yml\r\nAppBundle\\Service\\SerializerHandler:\r\n        tags:\r\n            - { name: 'jms_serializer.subscribing_handler', type: 'integer', format: 'json', method: 'serializeIntToJson' }\r\n````\r\n\r\nThis throws this error\r\n\r\n> The service \"AppBundle\\Service\\SerializerHandler\" must implement the SubscribingHandlerInterface.\r\n\r\nAny idea?"}}
{"actor":{"display_login":"goetas"}}