{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/45543811","id":45543811,"diff_hunk":"@@ -0,0 +1,87 @@\n+<?php\n+\n+/*\n+ * This file is part of the PHP CS utility.\n+ *\n+ * (c) Fabien Potencier <fabien@symfony.com>\n+ *\n+ * This source file is subject to the MIT license that is bundled\n+ * with this source code in the file LICENSE.\n+ */\n+\n+namespace Symfony\\CS\\Tests\\Fixer\\Contrib;\n+\n+use Symfony\\CS\\Tests\\Fixer\\AbstractFixerTestBase;\n+\n+final class MethodArgumentDefaultValueFixerTest extends AbstractFixerTestBase\n+{\n+    /**\n+     * @dataProvider provideExamples\n+     *\n+     * @param string      $expected\n+     * @param string|null $input\n+     */\n+    public function testFix($expected, $input = null)\n+    {\n+        $this->makeTest($expected, $input);\n+    }\n+\n+    /**\n+     * @return array\n+     */\n+    public function provideExamples()\n+    {\n+        return array(\n+            array(\n+                '<?php function bFunction($foo, $bar) {}',\n+                '<?php function bFunction($foo = null, $bar) {}',\n+            ),\n+            array(\n+                '<?php function bFunction($foo, $bar) {}',\n+                '<?php function bFunction($foo = \\'two words\\', $bar) {}',\n+            ),\n+            array(\n+                '<?php function cFunction($foo, $bar, $baz) {}',\n+                '<?php function cFunction($foo = false, $bar = \\'bar\\', $baz) {}',\n+            ),\n+            array(\n+                '<?php function dFunction($foo, $bar, $baz) {}',\n+                '<?php function dFunction($foo = false, $bar, $baz) {}',\n+            ),\n+            array(\n+                '<?php function foo (Foo $bar = null, $baz) {}',\n+            ),\n+            array(\n+                '<?php function eFunction($foo, $bar, \\SplFileInfo $baz, $x = \\'default\\') {}',\n+                '<?php function eFunction($foo, $bar = \\'removedDefault\\', \\SplFileInfo $baz, $x = \\'default\\') {}',\n+            ),\n+            array(\n+                <<<'EOT'\n+                    <?php\n+                        function eFunction($foo, $bar, \\SplFileInfo $baz, $x = 'default' {};\n+\n+                        function fFunction($foo, $bar, \\SplFileInfo $baz, $x = 'default') {};\n+EOT\n+                ,\n+                <<<'EOT'\n+                    <?php\n+                        function eFunction($foo, $bar, \\SplFileInfo $baz, $x = 'default' {};\n+\n+                        function fFunction($foo, $bar = 'removedValue', \\SplFileInfo $baz, $x = 'default') {};\n+EOT\n+            ),\n+            array(\n+                '<?php function foo ($bar, $c) {}',\n+                '<?php function foo ($bar /* a */ = /* b */ 1, $c) {}',","path":"Symfony/CS/Tests/Fixer/Contrib/MethodArgumentDefaultValueFixerTest.php","position":75,"original_position":75,"commit_id":"ebd1d7313d2eb39c7f76b52eae22db9e7ce367ce","original_commit_id":"ebd1d7313d2eb39c7f76b52eae22db9e7ce367ce","user":{"login":"SpacePossum","id":10462973,"avatar_url":"https://avatars.githubusercontent.com/u/10462973?v=3","gravatar_id":"","url":"https://api.github.com/users/SpacePossum","html_url":"https://github.com/SpacePossum","followers_url":"https://api.github.com/users/SpacePossum/followers","following_url":"https://api.github.com/users/SpacePossum/following{/other_user}","gists_url":"https://api.github.com/users/SpacePossum/gists{/gist_id}","starred_url":"https://api.github.com/users/SpacePossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpacePossum/subscriptions","organizations_url":"https://api.github.com/users/SpacePossum/orgs","repos_url":"https://api.github.com/users/SpacePossum/repos","events_url":"https://api.github.com/users/SpacePossum/events{/privacy}","received_events_url":"https://api.github.com/users/SpacePossum/received_events","type":"User","site_admin":false},"body":"Why are the comments removed?\r\nWhat will this fixer do with something like:\r\n```php\r\nfunction foo(\r\n  $a = 1, // test\r\n  $b = 2, /* test*/\r\n  $c = null, // abc\r\n  $d \r\n) {}\r\n","created_at":"2015-11-21T09:20:33Z","updated_at":"2015-11-21T09:20:33Z","html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1493#discussion_r45543811","pull_request_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/45543811"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1493#discussion_r45543811"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493"}}},"pull_request":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493","id":50190752,"html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1493","diff_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1493.diff","patch_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1493.patch","issue_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1493","number":1493,"state":"open","locked":false,"title":"Add a fixer to remove impossible default arguments","user":{"login":"lmanzke","id":7486693,"avatar_url":"https://avatars.githubusercontent.com/u/7486693?v=3","gravatar_id":"","url":"https://api.github.com/users/lmanzke","html_url":"https://github.com/lmanzke","followers_url":"https://api.github.com/users/lmanzke/followers","following_url":"https://api.github.com/users/lmanzke/following{/other_user}","gists_url":"https://api.github.com/users/lmanzke/gists{/gist_id}","starred_url":"https://api.github.com/users/lmanzke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmanzke/subscriptions","organizations_url":"https://api.github.com/users/lmanzke/orgs","repos_url":"https://api.github.com/users/lmanzke/repos","events_url":"https://api.github.com/users/lmanzke/events{/privacy}","received_events_url":"https://api.github.com/users/lmanzke/received_events","type":"User","site_admin":false},"body":"Hey guys, glad to be doing my first PR for you :).\r\n\r\nMy colleague @dereuromark opened an issue for a new fixer suggestion a while ago.\r\nhttps://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/1462\r\n\r\nHere is the PR implementing it. I took his solution and refactored it, please feel free to have a look.\r\n\r\nI tried to make it as readable as possible. \r\n\r\nMaybe you have some suggestion on how finding the next occurrence of a Variable OR certain token might be done more conveniently. I thought I could use\r\n\r\n```\r\n$tokens->getNextTokenOfKind(T_VARIABLE) \r\n```\r\n\r\nhere, but it does not work that way ;).\r\n\r\nLooking forward to your feedback!\r\n\r\nBest regards,\r\n\r\nLucas","created_at":"2015-11-09T22:57:32Z","updated_at":"2015-11-21T09:20:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"72e4cd916bab24d21990c1fff756f3587a48c34e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493/commits","review_comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493/comments","review_comment_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1493/comments","statuses_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/ebd1d7313d2eb39c7f76b52eae22db9e7ce367ce","head":{"label":"lmanzke:feature-default-arguments","ref":"feature-default-arguments","sha":"ebd1d7313d2eb39c7f76b52eae22db9e7ce367ce","user":{"login":"lmanzke","id":7486693,"avatar_url":"https://avatars.githubusercontent.com/u/7486693?v=3","gravatar_id":"","url":"https://api.github.com/users/lmanzke","html_url":"https://github.com/lmanzke","followers_url":"https://api.github.com/users/lmanzke/followers","following_url":"https://api.github.com/users/lmanzke/following{/other_user}","gists_url":"https://api.github.com/users/lmanzke/gists{/gist_id}","starred_url":"https://api.github.com/users/lmanzke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmanzke/subscriptions","organizations_url":"https://api.github.com/users/lmanzke/orgs","repos_url":"https://api.github.com/users/lmanzke/repos","events_url":"https://api.github.com/users/lmanzke/events{/privacy}","received_events_url":"https://api.github.com/users/lmanzke/received_events","type":"User","site_admin":false},"repo":{"id":45071310,"name":"PHP-CS-Fixer","full_name":"lmanzke/PHP-CS-Fixer","owner":{"login":"lmanzke","id":7486693,"avatar_url":"https://avatars.githubusercontent.com/u/7486693?v=3","gravatar_id":"","url":"https://api.github.com/users/lmanzke","html_url":"https://github.com/lmanzke","followers_url":"https://api.github.com/users/lmanzke/followers","following_url":"https://api.github.com/users/lmanzke/following{/other_user}","gists_url":"https://api.github.com/users/lmanzke/gists{/gist_id}","starred_url":"https://api.github.com/users/lmanzke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmanzke/subscriptions","organizations_url":"https://api.github.com/users/lmanzke/orgs","repos_url":"https://api.github.com/users/lmanzke/repos","events_url":"https://api.github.com/users/lmanzke/events{/privacy}","received_events_url":"https://api.github.com/users/lmanzke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lmanzke/PHP-CS-Fixer","description":"Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible)","fork":true,"url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer","forks_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/forks","keys_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/teams","hooks_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/hooks","issue_events_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/issues/events{/number}","events_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/events","assignees_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/assignees{/user}","branches_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/branches{/branch}","tags_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/tags","blobs_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/statuses/{sha}","languages_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/languages","stargazers_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/stargazers","contributors_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/contributors","subscribers_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/subscribers","subscription_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/subscription","commits_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/contents/{+path}","compare_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/merges","archive_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/downloads","issues_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/issues{/number}","pulls_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/pulls{/number}","milestones_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/milestones{/number}","notifications_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/labels{/name}","releases_url":"https://api.github.com/repos/lmanzke/PHP-CS-Fixer/releases{/id}","created_at":"2015-10-27T21:31:09Z","updated_at":"2015-10-27T21:31:10Z","pushed_at":"2015-11-13T13:03:11Z","git_url":"git://github.com/lmanzke/PHP-CS-Fixer.git","ssh_url":"git@github.com:lmanzke/PHP-CS-Fixer.git","clone_url":"https://github.com/lmanzke/PHP-CS-Fixer.git","svn_url":"https://github.com/lmanzke/PHP-CS-Fixer","homepage":"cs.sensiolabs.org","size":3546,"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":"1.11"}},"base":{"label":"FriendsOfPHP:1.11","ref":"1.11","sha":"f8890b658a8a8a3f160dd192f98f86e65f6c3bd4","user":{"login":"FriendsOfPHP","id":5947812,"avatar_url":"https://avatars.githubusercontent.com/u/5947812?v=3","gravatar_id":"","url":"https://api.github.com/users/FriendsOfPHP","html_url":"https://github.com/FriendsOfPHP","followers_url":"https://api.github.com/users/FriendsOfPHP/followers","following_url":"https://api.github.com/users/FriendsOfPHP/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfPHP/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfPHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfPHP/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfPHP/orgs","repos_url":"https://api.github.com/users/FriendsOfPHP/repos","events_url":"https://api.github.com/users/FriendsOfPHP/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfPHP/received_events","type":"Organization","site_admin":false},"repo":{"id":4344257,"name":"PHP-CS-Fixer","full_name":"FriendsOfPHP/PHP-CS-Fixer","owner":{"login":"FriendsOfPHP","id":5947812,"avatar_url":"https://avatars.githubusercontent.com/u/5947812?v=3","gravatar_id":"","url":"https://api.github.com/users/FriendsOfPHP","html_url":"https://github.com/FriendsOfPHP","followers_url":"https://api.github.com/users/FriendsOfPHP/followers","following_url":"https://api.github.com/users/FriendsOfPHP/following{/other_user}","gists_url":"https://api.github.com/users/FriendsOfPHP/gists{/gist_id}","starred_url":"https://api.github.com/users/FriendsOfPHP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FriendsOfPHP/subscriptions","organizations_url":"https://api.github.com/users/FriendsOfPHP/orgs","repos_url":"https://api.github.com/users/FriendsOfPHP/repos","events_url":"https://api.github.com/users/FriendsOfPHP/events{/privacy}","received_events_url":"https://api.github.com/users/FriendsOfPHP/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer","description":"Analyzes some PHP source code and tries to fix coding standards issues (PSR-1 and PSR-2 compatible)","fork":false,"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer","forks_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/forks","keys_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/teams","hooks_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/hooks","issue_events_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/events{/number}","events_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/events","assignees_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/assignees{/user}","branches_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/branches{/branch}","tags_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/tags","blobs_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/{sha}","languages_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/languages","stargazers_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/stargazers","contributors_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/contributors","subscribers_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/subscribers","subscription_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/subscription","commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/contents/{+path}","compare_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/merges","archive_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/downloads","issues_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues{/number}","pulls_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls{/number}","milestones_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/milestones{/number}","notifications_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/labels{/name}","releases_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/releases{/id}","created_at":"2012-05-16T06:42:23Z","updated_at":"2015-11-20T13:43:49Z","pushed_at":"2015-11-20T23:15:31Z","git_url":"git://github.com/FriendsOfPHP/PHP-CS-Fixer.git","ssh_url":"git@github.com:FriendsOfPHP/PHP-CS-Fixer.git","clone_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer.git","svn_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer","homepage":"cs.sensiolabs.org","size":6375,"stargazers_count":2692,"watchers_count":2692,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":435,"mirror_url":null,"open_issues_count":90,"forks":435,"open_issues":90,"watchers":2692,"default_branch":"1.11"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1493"},"issue":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1493"},"comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1493/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493/comments"},"review_comment":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1493/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/ebd1d7313d2eb39c7f76b52eae22db9e7ce367ce"}}}}