{"action":"created","comment":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/comments/76626431","id":76626431,"diff_hunk":"@@ -89,6 +89,11 @@ public function add($name, $type = null, array $options = array(), array $fieldD\n \n         $group = $this->addFieldToCurrentGroup($label);\n \n+        // Try to autodetect type\n+        if ($name instanceof FormBuilderInterface && $type == null) {","path":"Form/FormMapper.php","position":5,"original_position":5,"commit_id":"5fd47f1ae7d4cf1b3abcf32b0892035cad7b6688","original_commit_id":"5fd47f1ae7d4cf1b3abcf32b0892035cad7b6688","user":{"login":"greg0ire","id":657779,"avatar_url":"https://avatars.githubusercontent.com/u/657779?v=3","gravatar_id":"","url":"https://api.github.com/users/greg0ire","html_url":"https://github.com/greg0ire","followers_url":"https://api.github.com/users/greg0ire/followers","following_url":"https://api.github.com/users/greg0ire/following{/other_user}","gists_url":"https://api.github.com/users/greg0ire/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0ire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0ire/subscriptions","organizations_url":"https://api.github.com/users/greg0ire/orgs","repos_url":"https://api.github.com/users/greg0ire/repos","events_url":"https://api.github.com/users/greg0ire/events{/privacy}","received_events_url":"https://api.github.com/users/greg0ire/received_events","type":"User","site_admin":false},"body":"> We use yoda conditions and strict checking in many methods at the moment.\r\n\r\nI know but if we can avoid these questionable practices with a dedicated function, why not? But `is_null()` is not that much better in terms of Yodaism… so, in this particular case, I'm not so sure what is best .","created_at":"2016-08-29T15:22:00Z","updated_at":"2016-08-29T15:22:00Z","html_url":"https://github.com/sonata-project/SonataAdminBundle/pull/4101#discussion_r76626431","pull_request_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101","_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/comments/76626431"},"html":{"href":"https://github.com/sonata-project/SonataAdminBundle/pull/4101#discussion_r76626431"},"pull_request":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101"}}},"pull_request":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101","id":82884147,"html_url":"https://github.com/sonata-project/SonataAdminBundle/pull/4101","diff_url":"https://github.com/sonata-project/SonataAdminBundle/pull/4101.diff","patch_url":"https://github.com/sonata-project/SonataAdminBundle/pull/4101.patch","issue_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/4101","number":4101,"state":"open","locked":false,"title":"Autodetect type when adding a FormBuilderInterface","user":{"login":"fbourigault","id":1116116,"avatar_url":"https://avatars.githubusercontent.com/u/1116116?v=3","gravatar_id":"","url":"https://api.github.com/users/fbourigault","html_url":"https://github.com/fbourigault","followers_url":"https://api.github.com/users/fbourigault/followers","following_url":"https://api.github.com/users/fbourigault/following{/other_user}","gists_url":"https://api.github.com/users/fbourigault/gists{/gist_id}","starred_url":"https://api.github.com/users/fbourigault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbourigault/subscriptions","organizations_url":"https://api.github.com/users/fbourigault/orgs","repos_url":"https://api.github.com/users/fbourigault/repos","events_url":"https://api.github.com/users/fbourigault/events{/privacy}","received_events_url":"https://api.github.com/users/fbourigault/received_events","type":"User","site_admin":false},"body":"I am targeting this branch, because it looks like a bug and it's BC.\r\n\r\nFixes #4100\r\n\r\n## Changelog\r\n```markdown\r\n### Fixed\r\n- auto-detect type when adding `FormBuilderInterface` to `FormMapper`\r\n```\r\n\r\n## Subject\r\nWhen adding a `FormBuilderInterface` to `FormMapper` the type is now auto-detected. This avoid repeating informations hold in the `FormBuilderInterface` when adding the field and is never overriding the type if provided.\r\n\r\n","created_at":"2016-08-26T13:03:20Z","updated_at":"2016-08-29T15:22:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32b2bb0ea5eb3e571d11a9569f2d11c3ce3e1407","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101/commits","review_comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101/comments","review_comment_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/4101/comments","statuses_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/statuses/5fd47f1ae7d4cf1b3abcf32b0892035cad7b6688","head":{"label":"fbourigault:detect-type-form-mapper","ref":"detect-type-form-mapper","sha":"5fd47f1ae7d4cf1b3abcf32b0892035cad7b6688","user":{"login":"fbourigault","id":1116116,"avatar_url":"https://avatars.githubusercontent.com/u/1116116?v=3","gravatar_id":"","url":"https://api.github.com/users/fbourigault","html_url":"https://github.com/fbourigault","followers_url":"https://api.github.com/users/fbourigault/followers","following_url":"https://api.github.com/users/fbourigault/following{/other_user}","gists_url":"https://api.github.com/users/fbourigault/gists{/gist_id}","starred_url":"https://api.github.com/users/fbourigault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbourigault/subscriptions","organizations_url":"https://api.github.com/users/fbourigault/orgs","repos_url":"https://api.github.com/users/fbourigault/repos","events_url":"https://api.github.com/users/fbourigault/events{/privacy}","received_events_url":"https://api.github.com/users/fbourigault/received_events","type":"User","site_admin":false},"repo":{"id":65545053,"name":"SonataAdminBundle","full_name":"fbourigault/SonataAdminBundle","owner":{"login":"fbourigault","id":1116116,"avatar_url":"https://avatars.githubusercontent.com/u/1116116?v=3","gravatar_id":"","url":"https://api.github.com/users/fbourigault","html_url":"https://github.com/fbourigault","followers_url":"https://api.github.com/users/fbourigault/followers","following_url":"https://api.github.com/users/fbourigault/following{/other_user}","gists_url":"https://api.github.com/users/fbourigault/gists{/gist_id}","starred_url":"https://api.github.com/users/fbourigault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fbourigault/subscriptions","organizations_url":"https://api.github.com/users/fbourigault/orgs","repos_url":"https://api.github.com/users/fbourigault/repos","events_url":"https://api.github.com/users/fbourigault/events{/privacy}","received_events_url":"https://api.github.com/users/fbourigault/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fbourigault/SonataAdminBundle","description":"AdminBundle - The missing Symfony2 Admin Generator","fork":true,"url":"https://api.github.com/repos/fbourigault/SonataAdminBundle","forks_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/forks","keys_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/teams","hooks_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/hooks","issue_events_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/issues/events{/number}","events_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/events","assignees_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/assignees{/user}","branches_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/branches{/branch}","tags_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/tags","blobs_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/languages","stargazers_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/stargazers","contributors_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/contributors","subscribers_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/subscribers","subscription_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/subscription","commits_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/contents/{+path}","compare_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/merges","archive_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/downloads","issues_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/issues{/number}","pulls_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/labels{/name}","releases_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/releases{/id}","deployments_url":"https://api.github.com/repos/fbourigault/SonataAdminBundle/deployments","created_at":"2016-08-12T10:25:48Z","updated_at":"2016-08-12T10:25:51Z","pushed_at":"2016-08-29T13:53:58Z","git_url":"git://github.com/fbourigault/SonataAdminBundle.git","ssh_url":"git@github.com:fbourigault/SonataAdminBundle.git","clone_url":"https://github.com/fbourigault/SonataAdminBundle.git","svn_url":"https://github.com/fbourigault/SonataAdminBundle","homepage":"http://sonata-project.org/bundles/admin","size":17883,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"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":"3.x"}},"base":{"label":"sonata-project:3.x","ref":"3.x","sha":"44cb87f360f5983cf380d67a13f0fffad3a9cc2b","user":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars.githubusercontent.com/u/404157?v=3","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"repo":{"id":1095228,"name":"SonataAdminBundle","full_name":"sonata-project/SonataAdminBundle","owner":{"login":"sonata-project","id":404157,"avatar_url":"https://avatars.githubusercontent.com/u/404157?v=3","gravatar_id":"","url":"https://api.github.com/users/sonata-project","html_url":"https://github.com/sonata-project","followers_url":"https://api.github.com/users/sonata-project/followers","following_url":"https://api.github.com/users/sonata-project/following{/other_user}","gists_url":"https://api.github.com/users/sonata-project/gists{/gist_id}","starred_url":"https://api.github.com/users/sonata-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonata-project/subscriptions","organizations_url":"https://api.github.com/users/sonata-project/orgs","repos_url":"https://api.github.com/users/sonata-project/repos","events_url":"https://api.github.com/users/sonata-project/events{/privacy}","received_events_url":"https://api.github.com/users/sonata-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonata-project/SonataAdminBundle","description":"AdminBundle - The missing Symfony2 Admin Generator","fork":false,"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle","forks_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/forks","keys_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/teams","hooks_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/hooks","issue_events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/events","assignees_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/tags","blobs_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/languages","stargazers_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/stargazers","contributors_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/contributors","subscribers_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/subscribers","subscription_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/subscription","commits_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/merges","archive_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/downloads","issues_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/labels{/name}","releases_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/releases{/id}","deployments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/deployments","created_at":"2010-11-19T17:08:52Z","updated_at":"2016-08-24T06:36:55Z","pushed_at":"2016-08-29T13:53:58Z","git_url":"git://github.com/sonata-project/SonataAdminBundle.git","ssh_url":"git@github.com:sonata-project/SonataAdminBundle.git","clone_url":"https://github.com/sonata-project/SonataAdminBundle.git","svn_url":"https://github.com/sonata-project/SonataAdminBundle","homepage":"http://sonata-project.org/bundles/admin","size":22348,"stargazers_count":1411,"watchers_count":1411,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1010,"mirror_url":null,"open_issues_count":273,"forks":1010,"open_issues":273,"watchers":1411,"default_branch":"3.x"}},"_links":{"self":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101"},"html":{"href":"https://github.com/sonata-project/SonataAdminBundle/pull/4101"},"issue":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/4101"},"comments":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/4101/comments"},"review_comments":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101/comments"},"review_comment":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/pulls/4101/commits"},"statuses":{"href":"https://api.github.com/repos/sonata-project/SonataAdminBundle/statuses/5fd47f1ae7d4cf1b3abcf32b0892035cad7b6688"}}}}
{"actor":{"display_login":"greg0ire"}}