{"action":"closed","issue":{"url":"https://api.github.com/repos/hautelook/AliceBundle/issues/138","labels_url":"https://api.github.com/repos/hautelook/AliceBundle/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/hautelook/AliceBundle/issues/138/comments","events_url":"https://api.github.com/repos/hautelook/AliceBundle/issues/138/events","html_url":"https://github.com/hautelook/AliceBundle/issues/138","id":107761051,"number":138,"title":"Alice Processors not working as stated in doc","user":{"login":"odoucet","id":199838,"avatar_url":"https://avatars.githubusercontent.com/u/199838?v=3","gravatar_id":"","url":"https://api.github.com/users/odoucet","html_url":"https://github.com/odoucet","followers_url":"https://api.github.com/users/odoucet/followers","following_url":"https://api.github.com/users/odoucet/following{/other_user}","gists_url":"https://api.github.com/users/odoucet/gists{/gist_id}","starred_url":"https://api.github.com/users/odoucet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/odoucet/subscriptions","organizations_url":"https://api.github.com/users/odoucet/orgs","repos_url":"https://api.github.com/users/odoucet/repos","events_url":"https://api.github.com/users/odoucet/events{/privacy}","received_events_url":"https://api.github.com/users/odoucet/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-22T17:25:20Z","updated_at":"2015-09-30T09:58:19Z","closed_at":"2015-09-30T09:58:19Z","body":"If we follow AliceBundle documentation on processors and add the following on services.yml : \r\n```yml\r\nservices:\r\n    alice.processor.user:\r\n        class: MyBundle\\DataFixtures\\Processor\\UserProcessor \r\n        tags: [ { name: hautelook_alice.alice.processor } ]\r\n```\r\nand follow Alice documentation on how to write a processor (https://github.com/nelmio/alice/blob/master/doc/processors.md#processors): \r\n```php\r\nnamespace Acme\\DemoBundle\\DataFixtures\\ORM;\r\n\r\nuse Nelmio\\Alice\\ProcessorInterface;\r\nuse Symfony\\Component\\DependencyInjection\\ContainerInterface;\r\n\r\nclass UserProcessor implements ProcessorInterface\r\n{\r\n    /**\r\n     * @var ContainerInterface\r\n     */\r\n    protected $container;\r\n\r\n    public function __construct(ContainerInterface $container)\r\n    {\r\n        $this->container = $container;\r\n    }\r\n\r\n    public function preProcess($object)\r\n    {\r\n    }\r\n\r\n    public function postProcess($object)\r\n    {\r\n    }\r\n}\r\n\r\n```\r\n\r\n, we have the following error : \r\n\r\n**[Symfony\\Component\\Debug\\Exception\\ContextErrorException]\r\n  Catchable Fatal Error: Argument 1 passed to xxx\\Processor\\UserProcessor::__construct() must implement interface Symfony\\Component\\DependencyInjection\\ContainerInterface, none given, called in /xxx/app/cache/test/appTestDebugProjectContainer.php on line 422 and defined**\r\n\r\nThis is because we have no arg on __construct() when calling our own Processor.\r\n\r\nI discovered that rewriting the Processor without arg on __construct works, but do not know if this is the correct behaviour. In all case, as this differs from Alice documentation, we should explain this in AliceBundle doc.\r\n\r\nThe working Processor class : \r\n\r\n```php\r\n<?php\r\n\r\nnamespace MyBundle\\DataFixtures\\Processor;\r\n\r\nuse Nelmio\\Alice\\ProcessorInterface;\r\nuse Symfony\\Component\\DependencyInjection\\ContainerInterface;\r\n\r\nclass MyProcessor implements ProcessorInterface\r\n{\r\n    public function __construct()\r\n    {\r\n    }\r\n\r\n    public function preProcess($object)\r\n    {\r\n    }\r\n\r\n    public function postProcess($object)\r\n    {\r\n    }\r\n}\r\n\r\n```\r\n"}}