Download the PHP package dbrans/stream-pipeline without Composer

On this page you can find all versions of the php package dbrans/stream-pipeline. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?
dbrans/stream-pipeline
Rate from 1 - 5
Rated 5.00 based on 1 reviews

Informations about the package stream-pipeline

Build Status

Stream Pipeline

A Stream based pipeline pattern implementation.

The Pipeline pattern uses ordered stages to process a sequence of input values. Each implemented task is represented by a stage of the pipeline. You can think of pipelines as similar to assembly lines in a factory, where each item in the assembly line is constructed in stages.

How it works

Stream pipeline allows you to go from writing expressions like:

to writing functional expressions like:

Getting started

The library is available as a Composer package on Packagist.org.

To install in your project, just run:

After this runs successfully, you can include the main class in your application logic:

Usage

You can initialize an Stream to use it:

A Stream object exposes several methods to operate with its elements:

The Stream class is immutable, so each chaining method returns a new Stream.

The execution of a Stream is lazy, so the elements are iterated just one time only when a terminal operation (forEach, reduce, toArray, collect...) is called.

Pipe operations

Each method allows a callable argument:

The library exposes some common operations to better readability:

Please see the Javadoc for more information.

Stream Methods

Initialization static operations:

Pipe operations:

Terminal operations:

All callable functions receive: function ($currentElement, $index, $originalIndex) as arguments. Example:

Pre-defined Collectors

There are pre-defined collector functions with some common operations. You can use them with the terminal operator collect():

For example:

Iterator classes

Example:

Operation classes


All versions of stream-pipeline with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dbrans/stream-pipeline contains the following files

Loading the files please wait ....