{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/76747611","id":76747611,"diff_hunk":"@@ -27,14 +27,20 @@\n      */\n     public function supports(Request $request, ArgumentMetadata $argument)\n     {\n-        return $argument->hasDefaultValue();\n+        return $argument->isNullable() || $argument->hasDefaultValue();\n     }\n \n     /**\n      * {@inheritdoc}\n      */\n     public function resolve(Request $request, ArgumentMetadata $argument)\n     {\n+        if ($argument->isNullable()) {","path":"src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/DefaultValueResolver.php","position":13,"original_position":13,"commit_id":"237104cdc2355bee18558c7c56442957235fa130","original_commit_id":"237104cdc2355bee18558c7c56442957235fa130","user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars.githubusercontent.com/u/243674?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"body":"`yield $argument->isNullable() ? null : $argument->getDefaultValue();`?","created_at":"2016-08-30T08:08:30Z","updated_at":"2016-08-30T08:08:30Z","html_url":"https://github.com/symfony/symfony/pull/19784#discussion_r76747611","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/19784","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/76747611"},"html":{"href":"https://github.com/symfony/symfony/pull/19784#discussion_r76747611"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19784"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/19784","id":83223264,"html_url":"https://github.com/symfony/symfony/pull/19784","diff_url":"https://github.com/symfony/symfony/pull/19784.diff","patch_url":"https://github.com/symfony/symfony/pull/19784.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/19784","number":19784,"state":"open","locked":false,"title":"[HttpKernel] Fixed the nullable support for php 7.1 and below","user":{"login":"iltar","id":1754678,"avatar_url":"https://avatars.githubusercontent.com/u/1754678?v=3","gravatar_id":"","url":"https://api.github.com/users/iltar","html_url":"https://github.com/iltar","followers_url":"https://api.github.com/users/iltar/followers","following_url":"https://api.github.com/users/iltar/following{/other_user}","gists_url":"https://api.github.com/users/iltar/gists{/gist_id}","starred_url":"https://api.github.com/users/iltar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iltar/subscriptions","organizations_url":"https://api.github.com/users/iltar/orgs","repos_url":"https://api.github.com/users/iltar/repos","events_url":"https://api.github.com/users/iltar/events{/privacy}","received_events_url":"https://api.github.com/users/iltar/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | 3.1\r\n| Bug fix?      | yes\r\n| New feature?  | no (debatable)\r\n| BC breaks?    | no\r\n| Deprecations? | yes\r\n| Tests pass?   | yes\r\n| Fixed tickets | #19771\r\n| License       | MIT\r\n| Doc PR        | ~\r\n\r\nThis PR gives support for for the new php 7.1 and will only work in beta3 or higher. I've had to backport the support to 3.1 because I consider this a bug that it won't work, even though 3.1 won't be supported for much longer. The deprecation I've added in the `ArgumentMetadata` should not be triggered as all framework cases create it with the argument. Just for developers who for some reason implemented this manually, I've added the deprecation.\r\n\r\n*If needed, I can re-open this against 3.2 and leave 3.1  \"broken\"*\r\n\r\nOn 7.1 lower than beta3 this will happen but shouldn't affect any higher versions (I hope).\r\n```\r\nThere was 1 failure:\r\n\r\n1) Symfony\\Component\\HttpKernel\\Tests\\ControllerMetadata\\ArgumentMetadataFactoryTest::testNullableTypesSignature\r\nFailed asserting that two arrays are equal.\r\n--- Expected\r\n+++ Actual\r\n@@ @@\r\n Array (\r\n     0 => Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata Object (...)\r\n     1 => Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata Object (\r\n         'name' => 'bar'\r\n-        'type' => 'stdClass'\r\n+        'type' => 'Symfony\\Component\\HttpKernel\\Tests\\Fixtures\\Controller\\stdClass'\r\n         'isVariadic' => false\r\n         'hasDefaultValue' => false\r\n         'defaultValue' => null\r\n         'isNullable' => true\r\n     )\r\n     2 => Symfony\\Component\\HttpKernel\\ControllerMetadata\\ArgumentMetadata Object (...)\r\n )\r\n\r\n/home/ivanderberg/projects/symfony/src/Symfony/Component/HttpKernel/Tests/ControllerMetadata/ArgumentMetadataFactoryTest.php:123\r\n``` \r\n","created_at":"2016-08-30T07:48:45Z","updated_at":"2016-08-30T08:08:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"538767d4695d21709f3ecd15fc263e9315e24295","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/19784/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/19784/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/19784/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/237104cdc2355bee18558c7c56442957235fa130","head":{"label":"iltar:fix/nullable-arguments","ref":"fix/nullable-arguments","sha":"237104cdc2355bee18558c7c56442957235fa130","user":{"login":"iltar","id":1754678,"avatar_url":"https://avatars.githubusercontent.com/u/1754678?v=3","gravatar_id":"","url":"https://api.github.com/users/iltar","html_url":"https://github.com/iltar","followers_url":"https://api.github.com/users/iltar/followers","following_url":"https://api.github.com/users/iltar/following{/other_user}","gists_url":"https://api.github.com/users/iltar/gists{/gist_id}","starred_url":"https://api.github.com/users/iltar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iltar/subscriptions","organizations_url":"https://api.github.com/users/iltar/orgs","repos_url":"https://api.github.com/users/iltar/repos","events_url":"https://api.github.com/users/iltar/events{/privacy}","received_events_url":"https://api.github.com/users/iltar/received_events","type":"User","site_admin":false},"repo":{"id":7439250,"name":"symfony","full_name":"iltar/symfony","owner":{"login":"iltar","id":1754678,"avatar_url":"https://avatars.githubusercontent.com/u/1754678?v=3","gravatar_id":"","url":"https://api.github.com/users/iltar","html_url":"https://github.com/iltar","followers_url":"https://api.github.com/users/iltar/followers","following_url":"https://api.github.com/users/iltar/following{/other_user}","gists_url":"https://api.github.com/users/iltar/gists{/gist_id}","starred_url":"https://api.github.com/users/iltar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iltar/subscriptions","organizations_url":"https://api.github.com/users/iltar/orgs","repos_url":"https://api.github.com/users/iltar/repos","events_url":"https://api.github.com/users/iltar/events{/privacy}","received_events_url":"https://api.github.com/users/iltar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iltar/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/iltar/symfony","forks_url":"https://api.github.com/repos/iltar/symfony/forks","keys_url":"https://api.github.com/repos/iltar/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iltar/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iltar/symfony/teams","hooks_url":"https://api.github.com/repos/iltar/symfony/hooks","issue_events_url":"https://api.github.com/repos/iltar/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/iltar/symfony/events","assignees_url":"https://api.github.com/repos/iltar/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/iltar/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/iltar/symfony/tags","blobs_url":"https://api.github.com/repos/iltar/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iltar/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iltar/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/iltar/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iltar/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/iltar/symfony/languages","stargazers_url":"https://api.github.com/repos/iltar/symfony/stargazers","contributors_url":"https://api.github.com/repos/iltar/symfony/contributors","subscribers_url":"https://api.github.com/repos/iltar/symfony/subscribers","subscription_url":"https://api.github.com/repos/iltar/symfony/subscription","commits_url":"https://api.github.com/repos/iltar/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/iltar/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/iltar/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/iltar/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/iltar/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/iltar/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iltar/symfony/merges","archive_url":"https://api.github.com/repos/iltar/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iltar/symfony/downloads","issues_url":"https://api.github.com/repos/iltar/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/iltar/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/iltar/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/iltar/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iltar/symfony/labels{/name}","releases_url":"https://api.github.com/repos/iltar/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/iltar/symfony/deployments","created_at":"2013-01-04T11:22:34Z","updated_at":"2015-02-06T10:55:28Z","pushed_at":"2016-08-30T07:51:08Z","git_url":"git://github.com/iltar/symfony.git","ssh_url":"git@github.com:iltar/symfony.git","clone_url":"https://github.com/iltar/symfony.git","svn_url":"https://github.com/iltar/symfony","homepage":"symfony.com","size":71809,"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:3.1","ref":"3.1","sha":"120a05d0e1537a171d266faf127051c5a41975dc","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-08-30T07:55:32Z","pushed_at":"2016-08-30T07:51:09Z","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":135234,"stargazers_count":12867,"watchers_count":12867,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5008,"mirror_url":null,"open_issues_count":764,"forks":5008,"open_issues":764,"watchers":12867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19784"},"html":{"href":"https://github.com/symfony/symfony/pull/19784"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/19784"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/19784/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19784/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/19784/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/237104cdc2355bee18558c7c56442957235fa130"}}}}
{"actor":{"display_login":"nicolas-grekas"}}