{"action":"closed","issue":{"url":"https://api.github.com/repos/dingo/api/issues/637","repository_url":"https://api.github.com/repos/dingo/api","labels_url":"https://api.github.com/repos/dingo/api/issues/637/labels{/name}","comments_url":"https://api.github.com/repos/dingo/api/issues/637/comments","events_url":"https://api.github.com/repos/dingo/api/issues/637/events","html_url":"https://github.com/dingo/api/issues/637","id":105724233,"number":637,"title":"Rename 'Dingo\\Api\\Http\\Response\\Factory::array'","user":{"login":"mrgrain","id":379814,"avatar_url":"https://avatars.githubusercontent.com/u/379814?v=3","gravatar_id":"","url":"https://api.github.com/users/mrgrain","html_url":"https://github.com/mrgrain","followers_url":"https://api.github.com/users/mrgrain/followers","following_url":"https://api.github.com/users/mrgrain/following{/other_user}","gists_url":"https://api.github.com/users/mrgrain/gists{/gist_id}","starred_url":"https://api.github.com/users/mrgrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrgrain/subscriptions","organizations_url":"https://api.github.com/users/mrgrain/orgs","repos_url":"https://api.github.com/users/mrgrain/repos","events_url":"https://api.github.com/users/mrgrain/events{/privacy}","received_events_url":"https://api.github.com/users/mrgrain/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-10T03:17:45Z","updated_at":"2016-02-26T10:11:23Z","closed_at":"2016-02-26T10:11:23Z","body":"Hello,\r\nfirst awesome package, I love it! :smile: \r\n\r\nSecond, I would suggest to rename the pseudo method [`Dingo\\Api\\Http\\Response\\Factory::array()`](https://github.com/dingo/api/blob/master/src/Http/Response/Factory.php#L251) to something else.\r\n\r\nWhy? Because `array` is a [reserved keyword](http://php.net/manual/en/reserved.keywords.php) in PHP. It might not cause any troubles right now, but it just can't be guaranteed. Plus there are numerous good reasons to follow this 'standard':\r\n* You have to use a hack to make it work\r\n* One (not so advanced user) might mistaken it with the actual array language construct\r\n* You don't have a proper class method to inspect, reflect, etc.\r\n* IDEs get confused about it\r\n* Any static code analyser might get confused\r\n\r\nAlso the naming is actual incorrect, because the method is not responding with an array, but rather with the raw content. Just compare the result of those two controller methods:\r\n```php\r\n    public function raw()\r\n    {\r\n        return array(); // Response: []\r\n    }\r\n\r\n    public function asArray()\r\n    {\r\n        return $this->response->array(array()); // Response: []\r\n    }\r\n````\r\n\r\nThus, I suggest to rename said method to `raw` or something similar, unless you don't want to drop it anyway (cause it is rather superfluous).\r\n\r\n"}}