{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/45933452","id":45933452,"diff_hunk":"@@ -0,0 +1,173 @@\n+<?php\n+\n+namespace Symfony\\CS\\Tests\\Fixer\\PSR2;\n+\n+use Symfony\\CS\\Tests\\Fixer\\AbstractFixerTestBase;\n+\n+/**\n+ * @author Sullivan Senechal <soullivaneuh@gmail.com>\n+ */\n+class SwitchCaseSpaceFixerTest extends AbstractFixerTestBase\n+{\n+    /**\n+     * @dataProvider provideFixCases\n+     */\n+    public function testFix($expected, $input = null)\n+    {\n+        $this->makeTest($expected, $input);\n+    }\n+\n+    public function provideFixCases()\n+    {\n+        return array(\n+            array(\n+                '<?php\n+                switch ($a) {\n+                    case \"prod\":\n+                        break;\n+                }\n+                ',\n+            ),\n+            array(\n+                '<?php\n+                switch ($a) {\n+                    case 42:\n+                        break;\n+                }\n+                ',\n+            ),\n+            array(\n+                '<?php\n+                switch ($a) {\n+                    case false:\n+                        break;\n+                }\n+                ',\n+            ),\n+            array(\n+                '<?php\n+                switch ($a) {\n+                    case \"prod\":\n+                        break;\n+                }\n+                ',\n+                '<?php\n+                switch ($a) {\n+                    case \"prod\" :\n+                        break;\n+                }\n+                ',\n+            ),\n+            array(\n+                '<?php\n+                switch ($a) {\n+                    case 42:\n+                        break;\n+                }\n+                ',\n+                '<?php\n+                switch ($a) {\n+                    case 42 :\n+                        break;\n+                }\n+                ',\n+            ),\n+            array(\n+                '<?php\n+                switch ($a) {\n+                    case false:\n+                        break;\n+                }\n+                ',\n+                '<?php\n+                switch ($a) {\n+                    case false :\n+                        break;\n+                }\n+                ',\n+            ),\n+            array(\n+                '<?php\n+                switch ($a) {\n+                    case 42:\n+                        break;\n+                }\n+                ',\n+                '<?php\n+                switch ($a) {\n+                    case 42    :\n+                        break;\n+                }\n+                ',\n+            ),\n+            array(\n+                '<?php\n+                $a = 5.1;\n+                $b = 1.0;\n+                switch($a) {\n+                    case (int) $a < 1: {\n+                        echo \"leave alone\";\n+                        break;\n+                    }\n+                    case ($a < 2)/* test */: {\n+                        echo \"fix 1\";\n+                        break;\n+                    }\n+                    case (3): {\n+                        echo \"fix 2\";\n+                        break;\n+                    }\n+                    case /**/(/**/ // test\n+                        4\n+                        /**/)//\n+                        /**/: {\n+                        echo \"fix 3\";\n+                        break;\n+                    }\n+                    case (((int)$b) + 4.1): {\n+                        echo \"fix 4\";\n+                        break;\n+                    }\n+                    case ($b + 1) * 2: {\n+                        echo \"leave alone\";\n+                        break;\n+                    }\n+                }\n+                ',\n+                '<?php\n+                $a = 5.1;\n+                $b = 1.0;\n+                switch($a) {\n+                    case (int) $a < 1 : {\n+                        echo \"leave alone\";\n+                        break;\n+                    }\n+                    case ($a < 2)/* test */ : {\n+                        echo \"fix 1\";\n+                        break;\n+                    }\n+                    case (3) : {\n+                        echo \"fix 2\";\n+                        break;\n+                    }\n+                    case /**/(/**/ // test\n+                        4\n+                        /**/)//\n+                        /**/ : {","path":"Symfony/CS/Tests/Fixer/PSR2/SwitchCaseSpaceFixerTest.php","position":156,"original_position":156,"commit_id":"f4efd7a04a5bb67f9cd1bd03ad1cbb51045d4b07","original_commit_id":"18685bc5f899dcd29c8ec6b7e331bb60ab1f32d6","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":"sounds good to me, it is what the fixer should do :)\r\n(I opt the tests to make sure the fixer does not delete the comments and does not crash, so all good to me)","created_at":"2015-11-26T00:14:21Z","updated_at":"2015-11-26T00:14:21Z","html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1543#discussion_r45933452","pull_request_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1543","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/45933452"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1543#discussion_r45933452"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1543"}}},"pull_request":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1543","id":51815952,"html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1543","diff_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1543.diff","patch_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1543.patch","issue_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1543","number":1543,"state":"open","locked":false,"title":"[WIP][PSR-2] Switch case space fixer","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"body":"Closes #1542.\r\n\r\n@keradus readme generator seems to be unsynced on `1.11` (elements are removed and my fixer not added). Could you please have a look?","created_at":"2015-11-25T16:25:51Z","updated_at":"2015-11-26T00:14:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f4b9a0d8f35bdbeca161324d49c387ac853202cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1543/commits","review_comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1543/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/1543/comments","statuses_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/f4efd7a04a5bb67f9cd1bd03ad1cbb51045d4b07","head":{"label":"Soullivaneuh:switch-case-space","ref":"switch-case-space","sha":"f4efd7a04a5bb67f9cd1bd03ad1cbb51045d4b07","user":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"repo":{"id":36450184,"name":"PHP-CS-Fixer","full_name":"Soullivaneuh/PHP-CS-Fixer","owner":{"login":"Soullivaneuh","id":1698357,"avatar_url":"https://avatars.githubusercontent.com/u/1698357?v=3","gravatar_id":"","url":"https://api.github.com/users/Soullivaneuh","html_url":"https://github.com/Soullivaneuh","followers_url":"https://api.github.com/users/Soullivaneuh/followers","following_url":"https://api.github.com/users/Soullivaneuh/following{/other_user}","gists_url":"https://api.github.com/users/Soullivaneuh/gists{/gist_id}","starred_url":"https://api.github.com/users/Soullivaneuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Soullivaneuh/subscriptions","organizations_url":"https://api.github.com/users/Soullivaneuh/orgs","repos_url":"https://api.github.com/users/Soullivaneuh/repos","events_url":"https://api.github.com/users/Soullivaneuh/events{/privacy}","received_events_url":"https://api.github.com/users/Soullivaneuh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Soullivaneuh/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/Soullivaneuh/PHP-CS-Fixer","forks_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/forks","keys_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/teams","hooks_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/hooks","issue_events_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/issues/events{/number}","events_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/events","assignees_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/assignees{/user}","branches_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/branches{/branch}","tags_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/tags","blobs_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/statuses/{sha}","languages_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/languages","stargazers_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/stargazers","contributors_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/contributors","subscribers_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/subscribers","subscription_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/subscription","commits_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/contents/{+path}","compare_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/merges","archive_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/downloads","issues_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/issues{/number}","pulls_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/pulls{/number}","milestones_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/milestones{/number}","notifications_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/labels{/name}","releases_url":"https://api.github.com/repos/Soullivaneuh/PHP-CS-Fixer/releases{/id}","created_at":"2015-05-28T16:05:56Z","updated_at":"2015-05-28T16:05:57Z","pushed_at":"2015-11-25T17:29:29Z","git_url":"git://github.com/Soullivaneuh/PHP-CS-Fixer.git","ssh_url":"git@github.com:Soullivaneuh/PHP-CS-Fixer.git","clone_url":"https://github.com/Soullivaneuh/PHP-CS-Fixer.git","svn_url":"https://github.com/Soullivaneuh/PHP-CS-Fixer","homepage":"cs.sensiolabs.org","size":3598,"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.9"}},"base":{"label":"FriendsOfPHP:1.11","ref":"1.11","sha":"539af978afa12df69b839ff707dc926029837d80","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-25T20:18:35Z","pushed_at":"2015-11-25T22:10:28Z","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":6497,"stargazers_count":2704,"watchers_count":2704,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":432,"mirror_url":null,"open_issues_count":92,"forks":432,"open_issues":92,"watchers":2704,"default_branch":"1.11"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1543"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1543"},"issue":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1543"},"comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1543/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1543/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/1543/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/f4efd7a04a5bb67f9cd1bd03ad1cbb51045d4b07"}}}}