Eris\Quantifier\Size::generateList PHP Method

generateList() private static method

private static generateList ( $maximum, callable $growth )
$growth callable
    private static function generateList($maximum, callable $growth)
    {
        $sizes = [];
        for ($x = 0; $x <= $maximum; $x++) {
            $candidateSize = call_user_func($growth, $x);
            if ($candidateSize <= $maximum) {
                $sizes[] = $candidateSize;
            } else {
                break;
            }
        }
        return new self($sizes);
    }