phpstreams\operations\LimitOperation::__construct PHP Method

__construct() public method

Construct a limited stream.
public __construct ( type $source, type $limit )
$source type
$limit type The number of items to show, at most.
    public function __construct($source, $limit)
    {
        parent::__construct($source);
        if ($limit < 0) {
            throw new InvalidArgumentException("Limit should be at least 0.");
        }
        $this->limit = $limit;
    }