{"action":"created","comment":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/26451698","id":26451698,"diff_hunk":"@@ -121,6 +121,76 @@ function (array $matches) {\n     }\n \n     /**\n+     * @dataProvider provideIsShortArrayCases\n+     */\n+    public function testIsShortArray($source, array $expected)\n+    {\n+        $tokens = Tokens::fromCode($source);\n+\n+        foreach ($expected as $index => $expected) {\n+            $this->assertSame($expected, $tokens->isShortArray($index));\n+        }\n+    }\n+\n+    public function provideIsShortArrayCases()\n+    {\n+        return array(\n+            array(\n+                '<?php [];',\n+                array(1 => true),\n+            ),\n+            array(\n+                '<?php [1, \"foo\"];',\n+                array(1 => true),\n+            ),\n+            array(\n+                '<?php [[]];',\n+                array(1 => true, 2 => true),\n+            ),\n+            array(\n+                '<?php [\"foo\", [\"bar\", \"baz\"]];',\n+                array(1 => true, 5 => true),\n+            ),\n+            array(\n+                '<?php (array) [1, 2];',\n+                array(3 => true),\n+            ),\n+            array(\n+                '<?php [1,2][$x];',\n+                array(1 => true, 6 => false),\n+            ),\n+        );\n+    }\n+\n+    /**\n+     * @dataProvider provideIsNotShortArrayCases\n+     */\n+    public function testIsNotShortArray($source)\n+    {\n+        $tokens = Tokens::fromCode($source);\n+\n+        foreach ($tokens as $index => $token) {\n+            $this->assertFalse($tokens->isShortArray($index));","path":"Symfony/CS/Tests/Tokenizer/TokensTest.php","position":53,"original_position":53,"commit_id":"aeef689ff67ecb6b9c503d370a201e650c33282e","original_commit_id":"aeef689ff67ecb6b9c503d370a201e650c33282e","user":{"login":"keradus","id":2716794,"avatar_url":"https://avatars.githubusercontent.com/u/2716794?v=3","gravatar_id":"","url":"https://api.github.com/users/keradus","html_url":"https://github.com/keradus","followers_url":"https://api.github.com/users/keradus/followers","following_url":"https://api.github.com/users/keradus/following{/other_user}","gists_url":"https://api.github.com/users/keradus/gists{/gist_id}","starred_url":"https://api.github.com/users/keradus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keradus/subscriptions","organizations_url":"https://api.github.com/users/keradus/orgs","repos_url":"https://api.github.com/users/keradus/repos","events_url":"https://api.github.com/users/keradus/events{/privacy}","received_events_url":"https://api.github.com/users/keradus/received_events","type":"User","site_admin":false},"body":"It will be harmfull when method starts throwing an exception for incorrect index (index that don't match for short or long array)","created_at":"2015-03-15T20:11:40Z","updated_at":"2015-03-15T20:11:40Z","html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1060#discussion_r26451698","pull_request_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1060","_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/comments/26451698"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1060#discussion_r26451698"},"pull_request":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1060"}}},"pull_request":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1060","id":31200837,"html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1060","diff_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1060.diff","patch_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1060.patch","issue_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1060","number":1060,"state":"open","locked":false,"title":"Tokens::isShortArray: tests and bugfixes","user":{"login":"gharlan","id":330436,"avatar_url":"https://avatars.githubusercontent.com/u/330436?v=3","gravatar_id":"","url":"https://api.github.com/users/gharlan","html_url":"https://github.com/gharlan","followers_url":"https://api.github.com/users/gharlan/followers","following_url":"https://api.github.com/users/gharlan/following{/other_user}","gists_url":"https://api.github.com/users/gharlan/gists{/gist_id}","starred_url":"https://api.github.com/users/gharlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gharlan/subscriptions","organizations_url":"https://api.github.com/users/gharlan/orgs","repos_url":"https://api.github.com/users/gharlan/repos","events_url":"https://api.github.com/users/gharlan/events{/privacy}","received_events_url":"https://api.github.com/users/gharlan/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-15T14:16:33Z","updated_at":"2015-03-15T20:11:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1a915162fa4a96a6b802c77532a61429229338b","assignee":null,"milestone":{"url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/milestones/11","html_url":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/milestones/v1.5.2","labels_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/milestones/11/labels","id":1022300,"number":11,"title":"v1.5.2","description":"","creator":{"login":"keradus","id":2716794,"avatar_url":"https://avatars.githubusercontent.com/u/2716794?v=3","gravatar_id":"","url":"https://api.github.com/users/keradus","html_url":"https://github.com/keradus","followers_url":"https://api.github.com/users/keradus/followers","following_url":"https://api.github.com/users/keradus/following{/other_user}","gists_url":"https://api.github.com/users/keradus/gists{/gist_id}","starred_url":"https://api.github.com/users/keradus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keradus/subscriptions","organizations_url":"https://api.github.com/users/keradus/orgs","repos_url":"https://api.github.com/users/keradus/repos","events_url":"https://api.github.com/users/keradus/events{/privacy}","received_events_url":"https://api.github.com/users/keradus/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2015-03-15T19:55:44Z","updated_at":"2015-03-15T19:56:36Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1060/commits","review_comments_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1060/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/1060/comments","statuses_url":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/aeef689ff67ecb6b9c503d370a201e650c33282e","head":{"label":"gharlan:bugfix-is-short-array","ref":"bugfix-is-short-array","sha":"aeef689ff67ecb6b9c503d370a201e650c33282e","user":{"login":"gharlan","id":330436,"avatar_url":"https://avatars.githubusercontent.com/u/330436?v=3","gravatar_id":"","url":"https://api.github.com/users/gharlan","html_url":"https://github.com/gharlan","followers_url":"https://api.github.com/users/gharlan/followers","following_url":"https://api.github.com/users/gharlan/following{/other_user}","gists_url":"https://api.github.com/users/gharlan/gists{/gist_id}","starred_url":"https://api.github.com/users/gharlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gharlan/subscriptions","organizations_url":"https://api.github.com/users/gharlan/orgs","repos_url":"https://api.github.com/users/gharlan/repos","events_url":"https://api.github.com/users/gharlan/events{/privacy}","received_events_url":"https://api.github.com/users/gharlan/received_events","type":"User","site_admin":false},"repo":{"id":32235173,"name":"PHP-CS-Fixer","full_name":"gharlan/PHP-CS-Fixer","owner":{"login":"gharlan","id":330436,"avatar_url":"https://avatars.githubusercontent.com/u/330436?v=3","gravatar_id":"","url":"https://api.github.com/users/gharlan","html_url":"https://github.com/gharlan","followers_url":"https://api.github.com/users/gharlan/followers","following_url":"https://api.github.com/users/gharlan/following{/other_user}","gists_url":"https://api.github.com/users/gharlan/gists{/gist_id}","starred_url":"https://api.github.com/users/gharlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gharlan/subscriptions","organizations_url":"https://api.github.com/users/gharlan/orgs","repos_url":"https://api.github.com/users/gharlan/repos","events_url":"https://api.github.com/users/gharlan/events{/privacy}","received_events_url":"https://api.github.com/users/gharlan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gharlan/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/gharlan/PHP-CS-Fixer","forks_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/forks","keys_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/teams","hooks_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/hooks","issue_events_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/issues/events{/number}","events_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/events","assignees_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/assignees{/user}","branches_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/branches{/branch}","tags_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/tags","blobs_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/git/refs{/sha}","trees_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/statuses/{sha}","languages_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/languages","stargazers_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/stargazers","contributors_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/contributors","subscribers_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/subscribers","subscription_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/subscription","commits_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/commits{/sha}","git_commits_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/git/commits{/sha}","comments_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/comments{/number}","issue_comment_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/issues/comments{/number}","contents_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/contents/{+path}","compare_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/merges","archive_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/downloads","issues_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/issues{/number}","pulls_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/pulls{/number}","milestones_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/milestones{/number}","notifications_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/labels{/name}","releases_url":"https://api.github.com/repos/gharlan/PHP-CS-Fixer/releases{/id}","created_at":"2015-03-14T22:30:32Z","updated_at":"2015-03-14T22:30:33Z","pushed_at":"2015-03-15T17:17:43Z","git_url":"git://github.com/gharlan/PHP-CS-Fixer.git","ssh_url":"git@github.com:gharlan/PHP-CS-Fixer.git","clone_url":"https://github.com/gharlan/PHP-CS-Fixer.git","svn_url":"https://github.com/gharlan/PHP-CS-Fixer","homepage":"cs.sensiolabs.org","size":11480,"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.5","ref":"1.5","sha":"85777ebc6a1dac48c904acf9412b29b58b5dd592","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-14T23:39:14Z","pushed_at":"2015-03-13T19:40:52Z","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":11480,"stargazers_count":2032,"watchers_count":2032,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":319,"mirror_url":null,"open_issues_count":58,"forks":319,"open_issues":58,"watchers":2032,"default_branch":"1.5"}},"_links":{"self":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1060"},"html":{"href":"https://github.com/FriendsOfPHP/PHP-CS-Fixer/pull/1060"},"issue":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1060"},"comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/issues/1060/comments"},"review_comments":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/pulls/1060/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/1060/commits"},"statuses":{"href":"https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/statuses/aeef689ff67ecb6b9c503d370a201e650c33282e"}}}}