Skip to content

Instantly share code, notes, and snippets.

@maks-rafalko
Created October 11, 2017 20:26
Show Gist options
  • Save maks-rafalko/2639274dcbd027aad34aeb83ea61d75e to your computer and use it in GitHub Desktop.
Save maks-rafalko/2639274dcbd027aad34aeb83ea61d75e to your computer and use it in GitHub Desktop.
class UserFilterAge
{
const AGE_THRESHOLD = 18;
public function __invoke(array $collection)
{
- return array_filter(
+ array_filter(
$collection,
function (array $item) {
return $item['age'] >= self::AGE_THRESHOLD;
}
);
+ return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment