{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/26906860","id":26906860,"diff_hunk":"@@ -0,0 +1,110 @@\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+/**\n+ * @author Vladimir Reznichenko <kalessil@gmail.com>\n+ *\n+ * Fixes AliasFunctionsUsageInspection warnings from Php Inspections (EA Extended)\n+ */\n+class AliasFunctionsFixerTest extends AbstractFixerTestBase\n+{\n+    /**\n+     * @var array|string[]\n+     */\n+    private static $aliases = array(\n+        'is_double' => 'is_float',\n+        'is_integer' => 'is_int',\n+        'is_long' => 'is_int',\n+        'is_real' => 'is_float',\n+        'sizeof' => 'count',\n+        'doubleval' => 'floatval',\n+        'fputs' => 'fwrite',\n+        'join' => 'implode',\n+        'key_exists' => 'array_key_exists',\n+\n+        'chop' => 'rtrim',\n+        'close' => 'closedir',\n+        'ini_alter' => 'ini_set',\n+        'is_writeable' => 'is_writable',\n+        'magic_quotes_runtime' => 'set_magic_quotes_runtime',\n+        'pos' => 'current',\n+        'rewind' => 'rewinddir',\n+        'show_source' => 'highlight_file',\n+        'strchr' => 'strstr',\n+        );\n+\n+    /**\n+     * @dataProvider provideCases\n+     */\n+    public function testFix($expected, $input = null)\n+    {\n+        $this->makeTest($expected, $input);\n+    }\n+\n+    public function provideCases()\n+    {\n+        $validCases = array();\n+        $fixCases = array();\n+        foreach (static::$aliases as $alias => $master) {\n+            $validCases [] = array('<?php $smth->'.$alias.'($a);');\n+            $validCases [] = array('<?php '.$alias.'Smth($a);');\n+            $validCases [] = array('<?php smth_'.$alias.'($a);');\n+            $validCases [] = array('<?php new '.$alias.'($a);');\n+            $validCases [] = array('<?php Smth::'.$alias.'($a);');\n+            $validCases [] = array('<?php new '.$alias.'\\smth($a);');\n+            $validCases [] = array('<?php '.$alias.'::smth($a);');\n+            $validCases [] = array('<?php '.$alias.'\\smth($a);');\n+            $validCases [] = array('<?php \"SELECT ... '.$alias.'($a) ...\";');\n+            $validCases [] = array('<?php \"SELECT ... '.strtoupper($alias).'($a) ...\";');\n+            $validCases [] = array(\"<?php 'test'.'\".$alias.\"' . 'in concatenation';\");\n+            $validCases [] = array('<?php \"test\" . \"'.$alias.'\".\"in concatenation\";');\n+            $validCases [] = array(","path":"Symfony/CS/Tests/Fixer/Contrib/AliasFunctionsFixerTest.php","position":73,"original_position":73,"commit_id":"6dc66d3e911bc62ed37fa452d982e5f47f147f5c","original_commit_id":"6dc66d3e911bc62ed37fa452d982e5f47f147f5c","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":"you should remove the spaces before ``[]``","created_at":"2015-03-22T20:37:19Z","updated_at":"2015-03-22T20:37:19Z","html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1083#discussion_r26906860","pull_request_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1083","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/26906860"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1083#discussion_r26906860"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1083"}}},"pull_request":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1083","id":31694326,"html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1083","diff_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1083.diff","patch_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1083.patch","issue_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1083","number":1083,"state":"open","locked":false,"title":"AliasFunctionsFixer","user":{"login":"kalessil","id":1577185,"avatar_url":"https://avatars.githubusercontent.com/u/1577185?v=3","gravatar_id":"","url":"https://api.github.com/users/kalessil","html_url":"https://github.com/kalessil","followers_url":"https://api.github.com/users/kalessil/followers","following_url":"https://api.github.com/users/kalessil/following{/other_user}","gists_url":"https://api.github.com/users/kalessil/gists{/gist_id}","starred_url":"https://api.github.com/users/kalessil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalessil/subscriptions","organizations_url":"https://api.github.com/users/kalessil/orgs","repos_url":"https://api.github.com/users/kalessil/repos","events_url":"https://api.github.com/users/kalessil/events{/privacy}","received_events_url":"https://api.github.com/users/kalessil/received_events","type":"User","site_admin":false},"body":"Fixes AliasFunctionsUsageInspection inspection warnings from Php Inspections (EA Extended) - to use master functions instead of aliases.\r\n\r\nPS: recent <a href=\"https://github.com/symfony/symfony/pull/13862\">symfony PR</a> as reference.","created_at":"2015-03-22T20:32:02Z","updated_at":"2015-03-22T20:37:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae5575b72e45fb72ae97b5f51b46c25851b25995","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1083/commits","review_comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1083/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/1083/comments","statuses_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/6dc66d3e911bc62ed37fa452d982e5f47f147f5c","head":{"label":"kalessil:features-ea-extended","ref":"features-ea-extended","sha":"6dc66d3e911bc62ed37fa452d982e5f47f147f5c","user":{"login":"kalessil","id":1577185,"avatar_url":"https://avatars.githubusercontent.com/u/1577185?v=3","gravatar_id":"","url":"https://api.github.com/users/kalessil","html_url":"https://github.com/kalessil","followers_url":"https://api.github.com/users/kalessil/followers","following_url":"https://api.github.com/users/kalessil/following{/other_user}","gists_url":"https://api.github.com/users/kalessil/gists{/gist_id}","starred_url":"https://api.github.com/users/kalessil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalessil/subscriptions","organizations_url":"https://api.github.com/users/kalessil/orgs","repos_url":"https://api.github.com/users/kalessil/repos","events_url":"https://api.github.com/users/kalessil/events{/privacy}","received_events_url":"https://api.github.com/users/kalessil/received_events","type":"User","site_admin":false},"repo":{"id":32688700,"name":"PHP-CS-Fixer","full_name":"kalessil/PHP-CS-Fixer","owner":{"login":"kalessil","id":1577185,"avatar_url":"https://avatars.githubusercontent.com/u/1577185?v=3","gravatar_id":"","url":"https://api.github.com/users/kalessil","html_url":"https://github.com/kalessil","followers_url":"https://api.github.com/users/kalessil/followers","following_url":"https://api.github.com/users/kalessil/following{/other_user}","gists_url":"https://api.github.com/users/kalessil/gists{/gist_id}","starred_url":"https://api.github.com/users/kalessil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalessil/subscriptions","organizations_url":"https://api.github.com/users/kalessil/orgs","repos_url":"https://api.github.com/users/kalessil/repos","events_url":"https://api.github.com/users/kalessil/events{/privacy}","received_events_url":"https://api.github.com/users/kalessil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kalessil/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/kalessil/PHP-CS-Fixer","forks_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/forks","keys_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/teams","hooks_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/hooks","issue_events_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/issues/events{/number}","events_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/events","assignees_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/assignees{/user}","branches_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/branches{/branch}","tags_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/tags","blobs_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/statuses/{sha}","languages_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/languages","stargazers_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/stargazers","contributors_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/contributors","subscribers_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/subscribers","subscription_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/subscription","commits_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/contents/{+path}","compare_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/merges","archive_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/downloads","issues_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/issues{/number}","pulls_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/pulls{/number}","milestones_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/milestones{/number}","notifications_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/labels{/name}","releases_url":"https://api.github.com/repos/kalessil/PHP-CS-Fixer/releases{/id}","created_at":"2015-03-22T18:23:26Z","updated_at":"2015-03-22T18:23:26Z","pushed_at":"2015-03-22T19:32:15Z","git_url":"git://github.com/kalessil/PHP-CS-Fixer.git","ssh_url":"git@github.com:kalessil/PHP-CS-Fixer.git","clone_url":"https://github.com/kalessil/PHP-CS-Fixer.git","svn_url":"https://github.com/kalessil/PHP-CS-Fixer","homepage":"cs.sensiolabs.org","size":11421,"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.5"}},"base":{"label":"FriendsOfPHP:1.6","ref":"1.6","sha":"85a84bf3ea5ecf3b115b7551afd3d0bbf3d54136","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-03-22T14:30:45Z","pushed_at":"2015-03-22T20:32:04Z","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":11421,"stargazers_count":2060,"watchers_count":2060,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":321,"mirror_url":null,"open_issues_count":58,"forks":321,"open_issues":58,"watchers":2060,"default_branch":"1.5"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1083"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1083"},"issue":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1083"},"comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1083/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1083/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/1083/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/6dc66d3e911bc62ed37fa452d982e5f47f147f5c"}}}}