{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/9675","labels_url":"https://api.github.com/repos/laravel/framework/issues/9675/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/9675/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/9675/events","html_url":"https://github.com/laravel/framework/pull/9675","id":95816304,"number":9675,"title":"Skip unexisted classes files defined in config/compile.php.","user":{"login":"limonte","id":6059356,"avatar_url":"https://avatars.githubusercontent.com/u/6059356?v=3","gravatar_id":"","url":"https://api.github.com/users/limonte","html_url":"https://github.com/limonte","followers_url":"https://api.github.com/users/limonte/followers","following_url":"https://api.github.com/users/limonte/following{/other_user}","gists_url":"https://api.github.com/users/limonte/gists{/gist_id}","starred_url":"https://api.github.com/users/limonte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limonte/subscriptions","organizations_url":"https://api.github.com/users/limonte/orgs","repos_url":"https://api.github.com/users/limonte/repos","events_url":"https://api.github.com/users/limonte/events{/privacy}","received_events_url":"https://api.github.com/users/limonte/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-18T11:23:48Z","updated_at":"2015-07-18T11:34:46Z","closed_at":"2015-07-18T11:34:16Z","pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/9675","html_url":"https://github.com/laravel/framework/pull/9675","diff_url":"https://github.com/laravel/framework/pull/9675.diff","patch_url":"https://github.com/laravel/framework/pull/9675.patch"},"body":"Given: unexisted class defined in `config/compile.php`:\r\n\r\n![a](https://i.imgur.com/6cZHjbp.png)\r\n\r\nWhen: run `php artisan optimize`, then getting excaption `Invalid filnema provided`:\r\n\r\n![a](https://i.imgur.com/t7ylNJx.png)\r\n\r\nException is thrown in `ClassPreloader.php` (line 105)\r\n\r\n---\r\n\r\nI discovered that when dumping `$this->laravel['config']->get('compile.files', [])` in `OptimizeCommand.php` (line 125)\r\n\r\n![a](https://i.imgur.com/EQTSRJu.png)\r\n\r\nThen there's an element having `false` value in that array:\r\n\r\n![a](https://i.imgur.com/kLveoku.png)\r\n\r\nAnd that's because `realpath()` method in `config/compile.php` returns `false` if file does not exist.\r\n\r\nThis PR fix this by removing empty array elements from `$this->laravel['config']->get('compile.files', [])` by using [array_filter](http://www.php.net/manual/en/function.array-filter.php)."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/122532942","html_url":"https://github.com/laravel/framework/pull/9675#issuecomment-122532942","issue_url":"https://api.github.com/repos/laravel/framework/issues/9675","id":122532942,"user":{"login":"ArjanSchouten","id":5930718,"avatar_url":"https://avatars.githubusercontent.com/u/5930718?v=3","gravatar_id":"","url":"https://api.github.com/users/ArjanSchouten","html_url":"https://github.com/ArjanSchouten","followers_url":"https://api.github.com/users/ArjanSchouten/followers","following_url":"https://api.github.com/users/ArjanSchouten/following{/other_user}","gists_url":"https://api.github.com/users/ArjanSchouten/gists{/gist_id}","starred_url":"https://api.github.com/users/ArjanSchouten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArjanSchouten/subscriptions","organizations_url":"https://api.github.com/users/ArjanSchouten/orgs","repos_url":"https://api.github.com/users/ArjanSchouten/repos","events_url":"https://api.github.com/users/ArjanSchouten/events{/privacy}","received_events_url":"https://api.github.com/users/ArjanSchouten/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T11:34:46Z","updated_at":"2015-07-18T11:34:46Z","body":"@GrahamCampbell :+1: "}}