Download the PHP package brainite/splash without Composer

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

Splash

Tested against PHP 5.6/7.1/HHVM

CI

Splash is a chainable (and therefore concise) way to interact with the SPL iterators. The Standard PHP Library (SPL) provides various utility classes and interfaces to address common problems. Some of the most visible solutions center around the SPL Iterators. The ability to iterate over a non-array collection and then to iterate over that iterator creates an interesting design pattern for building with PHP. However, the iterators deprioritize conciseness and therefore (to some degree) readability.

Example Default SPL Iterator Usage

This example is extracted from the PHP manual.

As with any non-chainable procedural code, you have to read this from the inside out in an unnatural and error-prone way.

Example Splash Alternative

The value of $object should be identical within the foreach loop compared to the approach above. However, the layers of iterators and their corresponding constructor values are now organized linearly and with less code to improve readability. Ultimately, that is the singular purpose of Splash - to leverage the benefits of chaining in the context of Iterators.

Getting Started

  1. Install using composer: brainite/splash.
  2. Create splash objects via one of these methods:
    1. $splash = new \Splash\Splash(); // This is a basic approach.
    2. $splash = \Splash\Splash::go(); // This returns a Splash object that allows you to immediately chain.
    3. \Splash\Splash::mount(); // This makes the \splash() global function available for you to use for even more succinct coding. It creates a Splash object, and any arguments are added to an ArrayIterator that is thrown into the initial object via the push() method.

Equivalent examples:

Option 1

Option 2

Option 3

Option 4

For more examples, take a look at the unit tests.

Splash Custom Iterators

Splash comes bundles with some iterators that did not make it into SPL. Currently, this includes:

InverseRegexIterator

This is a simple iterator that excludes any items that match a regular expression.

`

SliceIterator

This is a simple iterator that narrows results to a slice like array_slice().

`

CallbackIterator

This is an iterator that runs a callback against each element and allows the callback to either return TRUE to retain values (like with CallbackFilterIterator) or to directly manipulate the new iterator. The direct advanced option allows for the splitting of values via the callback.

`


All versions of splash with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 brainite/splash contains the following files

Loading the files please wait ....