tomasz154/php-streams

View on GitHub
src/TerminalOperation/ToArray.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php


namespace T2\Streams\TerminalOperation;

use T2\Streams\Stream\StreamInterface;

class ToArray extends Reduce
{
    public function __construct(StreamInterface $stream)
    {
        parent::__construct($stream, [], function ($carry, $item) {
            $carry[] = $item;
            return $carry;
        });
    }
}