{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/18205","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/18205/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18205/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/18205/events","html_url":"https://github.com/symfony/symfony/pull/18205","id":141398748,"number":18205,"title":"[DX][Finder] Add a simple way to get the first and last result of a Finder","user":{"login":"kleiram","id":323498,"avatar_url":"https://avatars.githubusercontent.com/u/323498?v=3","gravatar_id":"","url":"https://api.github.com/users/kleiram","html_url":"https://github.com/kleiram","followers_url":"https://api.github.com/users/kleiram/followers","following_url":"https://api.github.com/users/kleiram/following{/other_user}","gists_url":"https://api.github.com/users/kleiram/gists{/gist_id}","starred_url":"https://api.github.com/users/kleiram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kleiram/subscriptions","organizations_url":"https://api.github.com/users/kleiram/orgs","repos_url":"https://api.github.com/users/kleiram/repos","events_url":"https://api.github.com/users/kleiram/events{/privacy}","received_events_url":"https://api.github.com/users/kleiram/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/DX","name":"DX","color":"5319e7"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Finder","name":"Finder","color":"DDDDDD"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-03-16T20:49:57Z","updated_at":"2016-03-17T11:07:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/18205","html_url":"https://github.com/symfony/symfony/pull/18205","diff_url":"https://github.com/symfony/symfony/pull/18205.diff","patch_url":"https://github.com/symfony/symfony/pull/18205.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #17991\r\n| License       | MIT\r\n| Doc PR        | -\r\n\r\nThis PR adds features to the Finder component. It allows you to get the first (and additionally) the last result in a Finder iterator. It should also close issue #17991.\r\n\r\nExample:\r\n\r\n```php\r\n$finder = new Finder();\r\n$finder->files()->in(__DIR__)->first(); // The first file in the directory.\r\n$finder->files()->in(__DIR__)->last(); // Obviously the last file in the directory.\r\n```"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/197824972","html_url":"https://github.com/symfony/symfony/pull/18205#issuecomment-197824972","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18205","id":197824972,"user":{"login":"mcfedr","id":704356,"avatar_url":"https://avatars.githubusercontent.com/u/704356?v=3","gravatar_id":"","url":"https://api.github.com/users/mcfedr","html_url":"https://github.com/mcfedr","followers_url":"https://api.github.com/users/mcfedr/followers","following_url":"https://api.github.com/users/mcfedr/following{/other_user}","gists_url":"https://api.github.com/users/mcfedr/gists{/gist_id}","starred_url":"https://api.github.com/users/mcfedr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcfedr/subscriptions","organizations_url":"https://api.github.com/users/mcfedr/orgs","repos_url":"https://api.github.com/users/mcfedr/repos","events_url":"https://api.github.com/users/mcfedr/events{/privacy}","received_events_url":"https://api.github.com/users/mcfedr/received_events","type":"User","site_admin":false},"created_at":"2016-03-17T11:07:59Z","updated_at":"2016-03-17T11:07:59Z","body":"@kleiram you would also want to change the return type of `getIterator()` so that the `first` and `last` methods can be found"}}