{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/32623646","id":32623646,"diff_hunk":"@@ -71,53 +77,153 @@ using a special \"tag\":\n \n     .. code-block:: yaml\n \n-        # app/config/services.yml\n+        # app/config/config.yml\n         services:\n             kernel.listener.your_listener_name:\n-                class: AppBundle\\EventListener\\AcmeExceptionListener\n+                class: AppBundle\\Listener\\ExceptionListener\n                 tags:\n-                    - { name: kernel.event_listener, event: kernel.exception, method: onKernelException }\n+                    - { name: kernel.event_listener, event: kernel.exception }\n \n     .. code-block:: xml\n \n-        <!-- app/config/services.xml -->\n-        <service id=\"kernel.listener.your_listener_name\" class=\"AppBundle\\EventListener\\AcmeExceptionListener\">\n-            <tag name=\"kernel.event_listener\" event=\"kernel.exception\" method=\"onKernelException\" />\n+        <!-- app/config/config.xml -->\n+        <service id=\"kernel.listener.your_listener_name\" class=\"AppBundle\\Listener\\ExceptionListener\">\n+            <tag name=\"kernel.event_listener\" event=\"kernel.exception\" />\n         </service>\n \n     .. code-block:: php\n \n-        // app/config/services.php\n+        // app/config/config.php\n         $container\n-            ->register('kernel.listener.your_listener_name', 'AppBundle\\EventListener\\AcmeExceptionListener')\n-            ->addTag('kernel.event_listener', array('event' => 'kernel.exception', 'method' => 'onKernelException'))\n+            ->register('kernel.listener.your_listener_name', 'AppBundle\\Listener\\ExceptionListener')\n+            ->addTag('kernel.event_listener', array('event' => 'kernel.exception'))\n         ;\n \n .. note::\n \n-    There is an additional tag option ``priority`` that is optional and defaults\n-    to 0. The listeners will be executed in the order of their priority (highest to lowest).\n-    This is useful when you need to guarantee that one listener is executed before another.\n+    There is an optional tag option called ``method`` which defines which method\n+    to execute when the event is triggered. By default the name of the method is\n+    ``on`` + \"camel-cased event name\". If the event is ``kernel.exception`` the\n+    method executed by default is ``onKernelException()``.\n+\n+    The other optional tag option is called  ``priority`` and it defaults to ``0``.\n+    This value ranges from ``-255`` to ``255`` and it controls the order in which\n+    listeners are executed (the highest the priority, the earlier a listener is\n+    executed). This is useful when you need to guarantee that one listener is\n+    executed before another.\n+\n+Creating an Event Subscriber\n+----------------------------\n+\n+Another way to listen to events is via an **event subscriber**, which is a class\n+that can define one or more methods that listen to one or various events. The","path":"cookbook/service_container/event_listener.rst","position":null,"original_position":135,"commit_id":"22c7ae0a297a2231c793c1884b4b5cdae091308b","original_commit_id":"a9d08abb41e93b9d545c73f274727807bb0fa625","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"body":"You are right. I've reworded the introduction of this section. Thanks.","created_at":"2015-06-17T13:06:54Z","updated_at":"2015-06-17T13:06:54Z","html_url":"https://github.com/symfony/symfony-docs/pull/5377#discussion_r32623646","pull_request_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/32623646"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/5377#discussion_r32623646"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377","id":37386944,"html_url":"https://github.com/symfony/symfony-docs/pull/5377","diff_url":"https://github.com/symfony/symfony-docs/pull/5377.diff","patch_url":"https://github.com/symfony/symfony-docs/pull/5377.patch","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/5377","number":5377,"state":"open","locked":false,"title":"Added a cookbook about event subscribers","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Doc fix?      | no\r\n| New docs?     | yes\r\n| Applies to    | all\r\n| Fixed tickets | -\r\n\r\nThis PR finishes the work made by @beni0888 in #4538.","created_at":"2015-06-10T18:06:56Z","updated_at":"2015-06-17T13:06:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"61685b60df962568e0c896b08bc51a60877ca4d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/issues/5377/comments","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/22c7ae0a297a2231c793c1884b4b5cdae091308b","head":{"label":"javiereguiluz:event_subscriber","ref":"event_subscriber","sha":"22c7ae0a297a2231c793c1884b4b5cdae091308b","user":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"repo":{"id":26866700,"name":"symfony-docs","full_name":"javiereguiluz/symfony-docs","owner":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars.githubusercontent.com/u/73419?v=3","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/javiereguiluz/symfony-docs","description":"The Symfony2 documentation","fork":true,"url":"https://api.github.com/repos/javiereguiluz/symfony-docs","forks_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/forks","keys_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/teams","hooks_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/events","assignees_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/tags","blobs_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/subscription","commits_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/merges","archive_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/downloads","issues_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/javiereguiluz/symfony-docs/releases{/id}","created_at":"2014-11-19T15:08:31Z","updated_at":"2015-02-02T17:06:05Z","pushed_at":"2015-06-17T13:06:29Z","git_url":"git://github.com/javiereguiluz/symfony-docs.git","ssh_url":"git@github.com:javiereguiluz/symfony-docs.git","clone_url":"https://github.com/javiereguiluz/symfony-docs.git","svn_url":"https://github.com/javiereguiluz/symfony-docs","homepage":"http://symfony.com/doc/current/","size":30399,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:2.3","ref":"2.3","sha":"5c0f8fb707c6fbde963fd3d1a5c7e1e5ca8e9389","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":521583,"name":"symfony-docs","full_name":"symfony/symfony-docs","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony-docs","description":"The Symfony documentation","fork":false,"url":"https://api.github.com/repos/symfony/symfony-docs","forks_url":"https://api.github.com/repos/symfony/symfony-docs/forks","keys_url":"https://api.github.com/repos/symfony/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony-docs/teams","hooks_url":"https://api.github.com/repos/symfony/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony-docs/events","assignees_url":"https://api.github.com/repos/symfony/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony-docs/tags","blobs_url":"https://api.github.com/repos/symfony/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony-docs/subscription","commits_url":"https://api.github.com/repos/symfony/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony-docs/merges","archive_url":"https://api.github.com/repos/symfony/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony-docs/downloads","issues_url":"https://api.github.com/repos/symfony/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony-docs/releases{/id}","created_at":"2010-02-17T08:43:51Z","updated_at":"2015-06-16T20:48:19Z","pushed_at":"2015-06-17T13:06:30Z","git_url":"git://github.com/symfony/symfony-docs.git","ssh_url":"git@github.com:symfony/symfony-docs.git","clone_url":"https://github.com/symfony/symfony-docs.git","svn_url":"https://github.com/symfony/symfony-docs","homepage":"http://symfony.com/doc","size":60322,"stargazers_count":992,"watchers_count":992,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1900,"mirror_url":null,"open_issues_count":297,"forks":1900,"open_issues":297,"watchers":992,"default_branch":"2.7"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/5377"},"issue":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/5377"},"comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/5377/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/5377/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony-docs/statuses/22c7ae0a297a2231c793c1884b4b5cdae091308b"}}}}