Skip to content

hunts/stream.php

Repository files navigation

Stream.php

build status Coverage Status

The stream.php library is a PHP implementation of collection query API similar to Java Stream API and .NET Linq.

Table of Contents


  1. Installation
  2. Classes and methods

Installation

Composer

composer require hunts/stream.php

Classes and methods

Usage

  1. Class Stream
  2. Class NumberStream
  3. Global Functions

Class Stream

Description: Instantiate a new Stream object

Example
use Hunts\Stream;
...
$stream = Stream::from([$user1, $user2, $user3]);

Class NumberStream

Description: Instantiate a new NumberStream object

Example
use Hunts\Stream;
...
$stream = NumberStream::from([1, 2, 3]);

Global functions

Description: Instantiate a new Stream object via global function: stream() or number_stream()

Example
$stream = stream([$user1, $user2, $user3]);
$stream = number_stream([1, 2, 3]);

Query API