Primitives for functional programming in PHP
PHP
Latest commit 38526dc Nov 30, 2016 @photodude photodude committed with Test against the current hhvm version (#116)
This provides the current HHVM version (3.15.2 as of this PR) and will track with each release (i.e. will be 3.16 when 3.16 is released).

If testing against HHVM LST versions is desired follow this guide. https://docs.travis-ci.com/user/languages/php#HHVM-versions

Should be able to change to container based Trusty after Q1-17 https://blog.travis-ci.com/2016-11-08-trusty-container-public-beta/

README.md

Functional PHP: Functional primitives for PHP

Gitter Build Status Dependency Status Average time to resolve an issue Percentage of issues still open Scrutinizer Code Quality

NOTE: functional-php used to come with a C extension that implemented most of the functions natively. As the performance differences weren’t that huge compared to the maintenance cost it has been removed.

A set of functional primitives for PHP, heavily inspired by Scala’s traversable collection, Dojo’s array functions and Underscore.js

  • Works with arrays and everything implementing interface Traversable
  • Consistent interface: for functions taking collections and callbacks, first parameter is always the collection, than the callback. Callbacks are always passed $value, $index, $collection. Strict comparison is the default but can be changed
  • Calls 5.3 closures as well as usual callbacks
  • All functions reside in namespace Functional to not raise conflicts with any other extension or library

Functional Comic

Installation with composer

Put the require statement for functional-php in your composer.json file and run php composer.phar install:

{
    "require": {
        "lstrojny/functional-php": "~1.2"
    }
}

Docs

Read the docs

Running the test suite

To run the test suite use vendor/bin/phpunit tests/

Mailing lists

Thank you