{"action":"created","issue":{"url":"https://api.github.com/repos/M6Web/StatsdBundle/issues/43","labels_url":"https://api.github.com/repos/M6Web/StatsdBundle/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/M6Web/StatsdBundle/issues/43/comments","events_url":"https://api.github.com/repos/M6Web/StatsdBundle/issues/43/events","html_url":"https://github.com/M6Web/StatsdBundle/issues/43","id":113013082,"number":43,"title":"2.12.1 bug","user":{"login":"jdeniau","id":1398469,"avatar_url":"https://avatars.githubusercontent.com/u/1398469?v=3","gravatar_id":"","url":"https://api.github.com/users/jdeniau","html_url":"https://github.com/jdeniau","followers_url":"https://api.github.com/users/jdeniau/followers","following_url":"https://api.github.com/users/jdeniau/following{/other_user}","gists_url":"https://api.github.com/users/jdeniau/gists{/gist_id}","starred_url":"https://api.github.com/users/jdeniau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdeniau/subscriptions","organizations_url":"https://api.github.com/users/jdeniau/orgs","repos_url":"https://api.github.com/users/jdeniau/repos","events_url":"https://api.github.com/users/jdeniau/events{/privacy}","received_events_url":"https://api.github.com/users/jdeniau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-23T12:52:25Z","updated_at":"2015-10-24T12:13:03Z","closed_at":null,"body":"Since the 2.12.1 version, I got a \r\n``` [Symfony\\Component\\DependencyInjection\\Exception\\RuntimeException]             \r\n  Unable to dump a service container if a parameter is an object or a resource.                                                                             \r\n```\r\nerror.\r\n\r\nI think it is because of [this](https://github.com/M6Web/StatsdBundle/blob/144862246094885655452c8cffddecd6b4f48891/src/DependencyInjection/M6WebStatsdExtension.php#L164)\r\n\r\nYou should probably not call the method itself but use the dependency injection system to call it (via a factory probably).: \r\n```\r\nPropertyAccess\\PropertyAccess::createPropertyAccessorBuilder()->enableMagicCall()->getPropertyAccessor()\r\n```"},"comment":{"url":"https://api.github.com/repos/M6Web/StatsdBundle/issues/comments/150803620","html_url":"https://github.com/M6Web/StatsdBundle/issues/43#issuecomment-150803620","issue_url":"https://api.github.com/repos/M6Web/StatsdBundle/issues/43","id":150803620,"user":{"login":"mguillermin","id":252093,"avatar_url":"https://avatars.githubusercontent.com/u/252093?v=3","gravatar_id":"","url":"https://api.github.com/users/mguillermin","html_url":"https://github.com/mguillermin","followers_url":"https://api.github.com/users/mguillermin/followers","following_url":"https://api.github.com/users/mguillermin/following{/other_user}","gists_url":"https://api.github.com/users/mguillermin/gists{/gist_id}","starred_url":"https://api.github.com/users/mguillermin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mguillermin/subscriptions","organizations_url":"https://api.github.com/users/mguillermin/orgs","repos_url":"https://api.github.com/users/mguillermin/repos","events_url":"https://api.github.com/users/mguillermin/events{/privacy}","received_events_url":"https://api.github.com/users/mguillermin/received_events","type":"User","site_admin":false},"created_at":"2015-10-24T12:13:03Z","updated_at":"2015-10-24T12:13:03Z","body":"@omansour You could also simply use a kind of \"lazy-initialization\" of the `PropertyAccessor` directly in the `Client` class (IMO there is no need to use the container here): \r\n\r\n```php\r\nclass Client\r\n{\r\n    //...\r\n    protected $propertyAccessor = null;\r\n    //...\r\n    private function getPropertyAccessor()\r\n    {\r\n        if (is_null($this->propertyAccessor)) {\r\n            $this->propertyAccessor = PropertyAccess::createPropertyAccessorBuilder()\r\n                ->enableMagicCall()\r\n                ->getPropertyAccessor();\r\n        }\r\n\r\n        return $this->propertyAccessor;\r\n    }\r\n    //...\r\n    private function replaceInNodeFormMethod($event, $eventName, $node)\r\n    {\r\n        $propertyAccessor = $this->getPropertyAccessor();\r\n        //...\r\n    }\r\n    //...\r\n}\r\n```\r\n"}}