Created
October 11, 2017 20:26
-
-
Save maks-rafalko/2639274dcbd027aad34aeb83ea61d75e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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