{"action":"created","issue":{"url":"https://api.github.com/repos/prettier/plugin-php/issues/258","repository_url":"https://api.github.com/repos/prettier/plugin-php","labels_url":"https://api.github.com/repos/prettier/plugin-php/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/prettier/plugin-php/issues/258/comments","events_url":"https://api.github.com/repos/prettier/plugin-php/issues/258/events","html_url":"https://github.com/prettier/plugin-php/issues/258","id":309472299,"number":258,"title":"Comments inside array definitions cause a crash","user":{"login":"cmancone","id":23659456,"avatar_url":"https://avatars1.githubusercontent.com/u/23659456?v=4","gravatar_id":"","url":"https://api.github.com/users/cmancone","html_url":"https://github.com/cmancone","followers_url":"https://api.github.com/users/cmancone/followers","following_url":"https://api.github.com/users/cmancone/following{/other_user}","gists_url":"https://api.github.com/users/cmancone/gists{/gist_id}","starred_url":"https://api.github.com/users/cmancone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmancone/subscriptions","organizations_url":"https://api.github.com/users/cmancone/orgs","repos_url":"https://api.github.com/users/cmancone/repos","events_url":"https://api.github.com/users/cmancone/events{/privacy}","received_events_url":"https://api.github.com/users/cmancone/received_events","type":"User","site_admin":false},"labels":[{"id":786680277,"url":"https://api.github.com/repos/prettier/plugin-php/labels/bug","name":"bug","color":"d93f0b","default":true},{"id":874641796,"url":"https://api.github.com/repos/prettier/plugin-php/labels/high-pri","name":"high-pri","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-28T18:06:17Z","updated_at":"2018-03-28T19:15:55Z","closed_at":null,"author_association":"NONE","body":"Input:\r\n```\r\n<?php\r\n$array = [\r\n    'key1'      => 'value1',\r\n    // a comment inside an array definition\r\n    'key2'      => 'value2',\r\n]\r\n```\r\n```\r\nyarn run v1.5.1\r\n$ prettier --plugin=. --parser=php test.php\r\n\r\n[error] test.php: Error: Comment \"// a comment inside an array definition\" was not printed. Please report this error!\r\n[error]     at astComments.forEach.comment (/var/www/prettier/plugin-php/node_modules/prettier/index.js:54:13)\r\n[error]     at Array.forEach (<anonymous>)\r\n[error]     at ensureAllCommentsPrinted (/var/www/prettier/plugin-php/node_modules/prettier/index.js:52:15)\r\n[error]     at formatWithCursor (/var/www/prettier/plugin-php/node_modules/prettier/index.js:117:3)\r\n[error]     at Object.formatWithCursor (/var/www/prettier/plugin-php/node_modules/prettier/index.js:390:12)\r\n[error]     at format (/var/www/prettier/plugin-php/node_modules/prettier/src/cli/util.js:157:19)\r\n[error]     at eachFilename (/var/www/prettier/plugin-php/node_modules/prettier/src/cli/util.js:382:16)\r\n[error]     at filePaths.forEach.filePath (/var/www/prettier/plugin-php/node_modules/prettier/src/cli/util.js:322:7)\r\n[error]     at Array.forEach (<anonymous>)\r\n[error]     at eachFilename (/var/www/prettier/plugin-php/node_modules/prettier/src/cli/util.js:321:15)\r\nerror An unexpected error occurred: \"Command failed.\r\nExit code: 2\r\nCommand: sh\r\nArguments: -c prettier --plugin=. --parser=php test.php\r\n```"},"comment":{"url":"https://api.github.com/repos/prettier/plugin-php/issues/comments/377003601","html_url":"https://github.com/prettier/plugin-php/issues/258#issuecomment-377003601","issue_url":"https://api.github.com/repos/prettier/plugin-php/issues/258","id":377003601,"user":{"login":"mgrip","id":13454680,"avatar_url":"https://avatars2.githubusercontent.com/u/13454680?v=4","gravatar_id":"","url":"https://api.github.com/users/mgrip","html_url":"https://github.com/mgrip","followers_url":"https://api.github.com/users/mgrip/followers","following_url":"https://api.github.com/users/mgrip/following{/other_user}","gists_url":"https://api.github.com/users/mgrip/gists{/gist_id}","starred_url":"https://api.github.com/users/mgrip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgrip/subscriptions","organizations_url":"https://api.github.com/users/mgrip/orgs","repos_url":"https://api.github.com/users/mgrip/repos","events_url":"https://api.github.com/users/mgrip/events{/privacy}","received_events_url":"https://api.github.com/users/mgrip/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T19:15:55Z","updated_at":"2018-03-28T19:15:55Z","author_association":"COLLABORATOR","body":"thanks @cmancone - think this should be fixed now that #255 is merged"}}
{"actor":{"display_login":"mgrip"}}