{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/64131255","id":64131255,"diff_hunk":"@@ -621,6 +621,57 @@ large or whether you tried to submit text in a number field.\n \n .. _book-forms-type-reference:\n \n+\n+Groups based on a callable service\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+If you need some advanced logic to determine the validation groups that cannot\n+be simply determined by a simple callback (for example that requires a few \n+services) you can use a service. Implement a service that implements __invoke\n+which accepts a FormInterface as a parameter.","path":"book/forms.rst","position":11,"original_position":11,"commit_id":"0900bbfcf2141dda7d6be73c82c853a5d3d5db9f","original_commit_id":"0900bbfcf2141dda7d6be73c82c853a5d3d5db9f","user":{"login":"WouterJ","id":749025,"avatar_url":"https://avatars.githubusercontent.com/u/749025?v=3","gravatar_id":"","url":"https://api.github.com/users/WouterJ","html_url":"https://github.com/WouterJ","followers_url":"https://api.github.com/users/WouterJ/followers","following_url":"https://api.github.com/users/WouterJ/following{/other_user}","gists_url":"https://api.github.com/users/WouterJ/gists{/gist_id}","starred_url":"https://api.github.com/users/WouterJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WouterJ/subscriptions","organizations_url":"https://api.github.com/users/WouterJ/orgs","repos_url":"https://api.github.com/users/WouterJ/repos","events_url":"https://api.github.com/users/WouterJ/events{/privacy}","received_events_url":"https://api.github.com/users/WouterJ/received_events","type":"User","site_admin":false},"body":"to indicate that the next block is a PHP code block, you should end this sentence with `::` or add a new line with `.. code-block:: php`","created_at":"2016-05-21T08:29:57Z","updated_at":"2016-05-21T08:29:57Z","html_url":"https://github.com/symfony/symfony-docs/pull/6579#discussion_r64131255","pull_request_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6579","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/comments/64131255"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/6579#discussion_r64131255"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6579"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6579","id":70766558,"html_url":"https://github.com/symfony/symfony-docs/pull/6579","diff_url":"https://github.com/symfony/symfony-docs/pull/6579.diff","patch_url":"https://github.com/symfony/symfony-docs/pull/6579.patch","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/6579","number":6579,"state":"open","locked":false,"title":"Added callable validation_groups example","user":{"login":"gnat42","id":325591,"avatar_url":"https://avatars.githubusercontent.com/u/325591?v=3","gravatar_id":"","url":"https://api.github.com/users/gnat42","html_url":"https://github.com/gnat42","followers_url":"https://api.github.com/users/gnat42/followers","following_url":"https://api.github.com/users/gnat42/following{/other_user}","gists_url":"https://api.github.com/users/gnat42/gists{/gist_id}","starred_url":"https://api.github.com/users/gnat42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnat42/subscriptions","organizations_url":"https://api.github.com/users/gnat42/orgs","repos_url":"https://api.github.com/users/gnat42/repos","events_url":"https://api.github.com/users/gnat42/events{/privacy}","received_events_url":"https://api.github.com/users/gnat42/received_events","type":"User","site_admin":false},"body":"Recently I had a need to dynamically set the validation_groups of a small set of forms based on the user that was logged in. In digging about the FormValidator::resolveValidationGroups and saw I could use a class that implements the __invoke method. Figured I might as well write something about it and see if you'd want to add it to the docs.","created_at":"2016-05-19T21:15:42Z","updated_at":"2016-05-21T08:29:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e3d3570d71954a9e359f37e4811c2e0f073ae145","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6579/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony-docs/pulls/6579/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/6579/comments","statuses_url":"https://api.github.com/repos/symfony/symfony-docs/statuses/0900bbfcf2141dda7d6be73c82c853a5d3d5db9f","head":{"label":"gnat42:patch-2","ref":"patch-2","sha":"0900bbfcf2141dda7d6be73c82c853a5d3d5db9f","user":{"login":"gnat42","id":325591,"avatar_url":"https://avatars.githubusercontent.com/u/325591?v=3","gravatar_id":"","url":"https://api.github.com/users/gnat42","html_url":"https://github.com/gnat42","followers_url":"https://api.github.com/users/gnat42/followers","following_url":"https://api.github.com/users/gnat42/following{/other_user}","gists_url":"https://api.github.com/users/gnat42/gists{/gist_id}","starred_url":"https://api.github.com/users/gnat42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnat42/subscriptions","organizations_url":"https://api.github.com/users/gnat42/orgs","repos_url":"https://api.github.com/users/gnat42/repos","events_url":"https://api.github.com/users/gnat42/events{/privacy}","received_events_url":"https://api.github.com/users/gnat42/received_events","type":"User","site_admin":false},"repo":{"id":7968724,"name":"symfony-docs","full_name":"gnat42/symfony-docs","owner":{"login":"gnat42","id":325591,"avatar_url":"https://avatars.githubusercontent.com/u/325591?v=3","gravatar_id":"","url":"https://api.github.com/users/gnat42","html_url":"https://github.com/gnat42","followers_url":"https://api.github.com/users/gnat42/followers","following_url":"https://api.github.com/users/gnat42/following{/other_user}","gists_url":"https://api.github.com/users/gnat42/gists{/gist_id}","starred_url":"https://api.github.com/users/gnat42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnat42/subscriptions","organizations_url":"https://api.github.com/users/gnat42/orgs","repos_url":"https://api.github.com/users/gnat42/repos","events_url":"https://api.github.com/users/gnat42/events{/privacy}","received_events_url":"https://api.github.com/users/gnat42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gnat42/symfony-docs","description":"The Symfony2 documentation","fork":true,"url":"https://api.github.com/repos/gnat42/symfony-docs","forks_url":"https://api.github.com/repos/gnat42/symfony-docs/forks","keys_url":"https://api.github.com/repos/gnat42/symfony-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gnat42/symfony-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gnat42/symfony-docs/teams","hooks_url":"https://api.github.com/repos/gnat42/symfony-docs/hooks","issue_events_url":"https://api.github.com/repos/gnat42/symfony-docs/issues/events{/number}","events_url":"https://api.github.com/repos/gnat42/symfony-docs/events","assignees_url":"https://api.github.com/repos/gnat42/symfony-docs/assignees{/user}","branches_url":"https://api.github.com/repos/gnat42/symfony-docs/branches{/branch}","tags_url":"https://api.github.com/repos/gnat42/symfony-docs/tags","blobs_url":"https://api.github.com/repos/gnat42/symfony-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gnat42/symfony-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gnat42/symfony-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/gnat42/symfony-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gnat42/symfony-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/gnat42/symfony-docs/languages","stargazers_url":"https://api.github.com/repos/gnat42/symfony-docs/stargazers","contributors_url":"https://api.github.com/repos/gnat42/symfony-docs/contributors","subscribers_url":"https://api.github.com/repos/gnat42/symfony-docs/subscribers","subscription_url":"https://api.github.com/repos/gnat42/symfony-docs/subscription","commits_url":"https://api.github.com/repos/gnat42/symfony-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/gnat42/symfony-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/gnat42/symfony-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/gnat42/symfony-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/gnat42/symfony-docs/contents/{+path}","compare_url":"https://api.github.com/repos/gnat42/symfony-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gnat42/symfony-docs/merges","archive_url":"https://api.github.com/repos/gnat42/symfony-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gnat42/symfony-docs/downloads","issues_url":"https://api.github.com/repos/gnat42/symfony-docs/issues{/number}","pulls_url":"https://api.github.com/repos/gnat42/symfony-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/gnat42/symfony-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/gnat42/symfony-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gnat42/symfony-docs/labels{/name}","releases_url":"https://api.github.com/repos/gnat42/symfony-docs/releases{/id}","deployments_url":"https://api.github.com/repos/gnat42/symfony-docs/deployments","created_at":"2013-02-01T23:40:31Z","updated_at":"2013-02-01T23:40:51Z","pushed_at":"2016-05-19T21:15:37Z","git_url":"git://github.com/gnat42/symfony-docs.git","ssh_url":"git@github.com:gnat42/symfony-docs.git","clone_url":"https://github.com/gnat42/symfony-docs.git","svn_url":"https://github.com/gnat42/symfony-docs","homepage":"http://symfony.com/doc/current/","size":34752,"stargazers_count":0,"watchers_count":0,"language":null,"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:3.0","ref":"3.0","sha":"0fb784728f946ee61056e089dd451b25cb56b2bc","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}","deployments_url":"https://api.github.com/repos/symfony/symfony-docs/deployments","created_at":"2010-02-17T08:43:51Z","updated_at":"2016-05-19T07:17:22Z","pushed_at":"2016-05-21T08:29:47Z","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":55108,"stargazers_count":1108,"watchers_count":1108,"language":"C++","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2424,"mirror_url":null,"open_issues_count":317,"forks":2424,"open_issues":317,"watchers":1108,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6579"},"html":{"href":"https://github.com/symfony/symfony-docs/pull/6579"},"issue":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/6579"},"comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/issues/6579/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony-docs/pulls/6579/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/6579/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony-docs/statuses/0900bbfcf2141dda7d6be73c82c853a5d3d5db9f"}}}}
{"actor":{"display_login":"WouterJ"}}