Created
September 28, 2017 20:25
-
-
Save maks-rafalko/d983c015d9073fa3a9e6dc3c862ce2a2 to your computer and use it in GitHub Desktop.
Medium: first mutation
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( | |
$collection, | |
function (array $item) { | |
- return $item['age'] >= self::AGE_THRESHOLD; | |
+ return $item['age'] > self::AGE_THRESHOLD; | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment