Skip to content

Instantly share code, notes, and snippets.

@joelhinz
Created September 12, 2018 11:30
Show Gist options
  • Save joelhinz/2b0c0a29c9884be8c2d85f2b79fc8c49 to your computer and use it in GitHub Desktop.
Save joelhinz/2b0c0a29c9884be8c2d85f2b79fc8c49 to your computer and use it in GitHub Desktop.
<?php
$countries->map(function ($country) {
return $country->capital;
})->reject(function ($capital) {
return $capital->isTiny();
})->partition(function ($capital) {
return $capital->hasMayor();
});
$countries->map->capital
->reject->isTiny()
->partition->hasMayor();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment