Download the PHP package smoren/sequence without Composer

On this page you can find all versions of the php package smoren/sequence. 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?

Informations about the package sequence

PHP Iterator-based sequences

Packagist PHP Version Support Scrutinizer Code Quality Coverage Status Build and test License: MIT

Python-like sequences with iterators for PHP.

How to install to your project

Quick Reference

Loops

Functionality Description Code Snippet
Range-based for Python-like range-based loop foreach(xrange($start, $size, $step) as $value)

Sequences

Class Description Code Snippet
Range Iterable arithmetic progression new Range($start, $size, $step)
Exponential Iterable geometric progression new Exponential($start, $size, $step)
DynamicSequence Callback-configurable sequence new DynamicSequence($start, $size, $nextValueGetter, $indexedValueGetter)

Data containers

Class Description Code Snippet
IndexedArray Python-like indexed list new IndexedArray($array)

Functions

Function Description Code Snippet
xrange Creates iterable range xrange($start, $size, $step)
map Maps iterable collections and returns IndexedArray of mapped values map($mapper, ...$collections)
filter Filters iterable collection and returning IndexedArray of filtered items filter($collection, $filter)
reduce Reduces an iterable collection reduce($collection, $reducer, $initialValue)

Usage

Loops

Range-based for

Unlike the PHP built-in function range(), xrange() does not create an array, but a Traversable object that takes up a small amount of memory, regardless of the number of elements in the sequence.

Sequences

Range

Iterable arithmetic progression.

For infinite sequence use $size = null.

Exponential

Iterable geometric progression.

For infinite sequence use $size = null.

Dynamic Sequence

Implementation of sequence configured with callables.

For infinite sequence use $size = null.

Data containers

Indexed Array

Python-like indexed list.

Its keys are always an unbroken sequence of natural numbers starting from zero.

It is also allowed to access array elements from the end with negative indices.

OutOfRangeException will be thrown when trying to access a non-existent index.

Functions

xrange

Creates iterable range.

Works like xrange() function in python2 or range() function in python3.

map

Maps iterable collection and creating IndexedArray of mapped values as a result.

filter

Filters iterable collection and returning IndexedArray of filtered items.

reduce

Reduces an iterable collection.

Unit testing

Standards

PHP Sequence conforms to the following standards:

License

PHP Sequence is licensed under the MIT License.


All versions of sequence 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 smoren/sequence contains the following files

Loading the files please wait ....