{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/58889715","id":58889715,"diff_hunk":"@@ -0,0 +1,168 @@\n+<?php\n+\n+/*\n+ * This file is part of the Symfony package.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace Symfony\\Component\\Form\\Tests\\Extension\\Core\\Type;\n+\n+use Symfony\\Component\\Form\\AbstractType;\n+use Symfony\\Component\\Form\\ChoiceList\\Loader\\CallbackChoiceLoader;\n+use Symfony\\Component\\Form\\Extension\\Core\\Type\\ChoiceType;\n+use Symfony\\Component\\Form\\Test\\TypeTestCase as TestCase;\n+use Symfony\\Component\\Form\\ChoiceList\\View\\ChoiceView;\n+use Symfony\\Component\\OptionsResolver\\OptionsResolver;\n+\n+/**\n+ * Tests children of choice type using a default choice loader.\n+ *\n+ * @author Jules Pietri <jules@heahprod.com>\n+ */\n+class LazyChoiceTypeTest extends TestCase","path":"src/Symfony/Component/Form/Tests/Extension/Core/Type/LazyChoiceTypeTest.php","position":26,"original_position":26,"commit_id":"77f1709932b20c6c21103c076af1da8079ee9b2b","original_commit_id":"deb1cbca5b00d8c18929171eeef53373f2e4ee57","user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"body":"and btw, AppVeyor runs the right version of ICU, so all PRs are tested properly on our CI.","created_at":"2016-04-07T15:17:56Z","updated_at":"2016-04-07T15:17:56Z","html_url":"https://github.com/symfony/symfony/pull/18332#discussion_r58889715","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/18332","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/58889715"},"html":{"href":"https://github.com/symfony/symfony/pull/18332#discussion_r58889715"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18332"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/18332","id":64270072,"html_url":"https://github.com/symfony/symfony/pull/18332","diff_url":"https://github.com/symfony/symfony/pull/18332.diff","patch_url":"https://github.com/symfony/symfony/pull/18332.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18332","number":18332,"state":"open","locked":false,"title":"[Form] added `CallbackChoiceLoader` and refactored ChoiceType's children","user":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | ~\r\n| License       | MIT\r\n| Doc PR        | todo\r\n\r\nTodo\r\n====\r\n- [ ] Address a doc PR\r\n- [ ] Update CHANGELOG\r\n\r\nChanges\r\n=======\r\n - 39e937f added `CallbackChoiceLoader` to lazy load choices with a simple callable.\r\n\r\n - 995dc56 refactored `CountryType`, `CurrencyType`, `LanguageType`, `LocaleType` and `TimezoneType` for better performance by using a default `CallbackChoiceLoader` for lazy loading.\r\n\r\n - deb1cbc added a `LazyChoiceTypeTest` class to allow testing children of choice type with lazy loading, even when their libraries are not available (e.g ICU data).\r\n\r\nUsage\r\n=====\r\n```php\r\nuse Symfony\\Component\\Form\\ChoiceList\\Loader\\CallbackChoiceLoader;\r\nuse Symfony\\Component\\Form\\Extension\\Core\\Type\\ChoiceType;\r\nuse Symfony\\Component\\Intl\\Intl;\r\n\r\n$builder->add('locales', ChoiceType::class, array(\r\n    'choice_loader' => new CallbackChoiceLoader(function() {\r\n            return array_flip(Intl::getLocaleBundle()->getLocaleNames());\r\n    },\r\n));\r\n```","created_at":"2016-03-27T17:00:29Z","updated_at":"2016-04-07T15:17:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5683cbe000ff5f8abc344881cea2c60038b0d3f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/18332/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/18332/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18332/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/77f1709932b20c6c21103c076af1da8079ee9b2b","head":{"label":"HeahDude:feature-form-immutable_choice_type","ref":"feature-form-immutable_choice_type","sha":"77f1709932b20c6c21103c076af1da8079ee9b2b","user":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"repo":{"id":27680958,"name":"symfony","full_name":"HeahDude/symfony","owner":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HeahDude/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/HeahDude/symfony","forks_url":"https://api.github.com/repos/HeahDude/symfony/forks","keys_url":"https://api.github.com/repos/HeahDude/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HeahDude/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HeahDude/symfony/teams","hooks_url":"https://api.github.com/repos/HeahDude/symfony/hooks","issue_events_url":"https://api.github.com/repos/HeahDude/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/HeahDude/symfony/events","assignees_url":"https://api.github.com/repos/HeahDude/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/HeahDude/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/HeahDude/symfony/tags","blobs_url":"https://api.github.com/repos/HeahDude/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HeahDude/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HeahDude/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/HeahDude/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HeahDude/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/HeahDude/symfony/languages","stargazers_url":"https://api.github.com/repos/HeahDude/symfony/stargazers","contributors_url":"https://api.github.com/repos/HeahDude/symfony/contributors","subscribers_url":"https://api.github.com/repos/HeahDude/symfony/subscribers","subscription_url":"https://api.github.com/repos/HeahDude/symfony/subscription","commits_url":"https://api.github.com/repos/HeahDude/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/HeahDude/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/HeahDude/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/HeahDude/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/HeahDude/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/HeahDude/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HeahDude/symfony/merges","archive_url":"https://api.github.com/repos/HeahDude/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HeahDude/symfony/downloads","issues_url":"https://api.github.com/repos/HeahDude/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/HeahDude/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/HeahDude/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/HeahDude/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HeahDude/symfony/labels{/name}","releases_url":"https://api.github.com/repos/HeahDude/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/HeahDude/symfony/deployments","created_at":"2014-12-07T19:00:38Z","updated_at":"2016-02-20T04:43:53Z","pushed_at":"2016-04-07T12:37:38Z","git_url":"git://github.com/HeahDude/symfony.git","ssh_url":"git@github.com:HeahDude/symfony.git","clone_url":"https://github.com/HeahDude/symfony.git","svn_url":"https://github.com/HeahDude/symfony","homepage":"symfony.com","size":70492,"stargazers_count":0,"watchers_count":0,"language":"PHP","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:master","ref":"master","sha":"45b557a5a7461738fc615cb80fc4076cbbdc251d","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":458058,"name":"symfony","full_name":"symfony/symfony","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","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-04-07T14:19:03Z","pushed_at":"2016-04-07T15:14:38Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":105770,"stargazers_count":12087,"watchers_count":12087,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4743,"mirror_url":null,"open_issues_count":712,"forks":4743,"open_issues":712,"watchers":12087,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18332"},"html":{"href":"https://github.com/symfony/symfony/pull/18332"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/18332"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/18332/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18332/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18332/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/77f1709932b20c6c21103c076af1da8079ee9b2b"}}}}