Hugo Sales e8e8000b16 Update composer dependencies 4 年 前
..
docs e8e8000b16 Update composer dependencies 4 年 前
src e8e8000b16 Update composer dependencies 4 年 前
tests e8e8000b16 Update composer dependencies 4 年 前
.editorconfig e8e8000b16 Update composer dependencies 4 年 前
.gitignore e8e8000b16 Update composer dependencies 4 年 前
.php_cs.dist e8e8000b16 Update composer dependencies 4 年 前
.phpstorm.meta.php e8e8000b16 Update composer dependencies 4 年 前
.scrutinizer.yml e8e8000b16 Update composer dependencies 4 年 前
.travis.yml e8e8000b16 Update composer dependencies 4 年 前
LICENSE e8e8000b16 Update composer dependencies 4 年 前
README.md e8e8000b16 Update composer dependencies 4 年 前
composer.json e8e8000b16 Update composer dependencies 4 年 前
phpcs.xml.dist e8e8000b16 Update composer dependencies 4 年 前
phpunit.xml.dist e8e8000b16 Update composer dependencies 4 年 前

README.md

Functional PHP: Functional primitives for PHP

Build Status

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, then 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

Run the following command in your project root:

composer require lstrojny/functional-php

Docs

Read the docs

Contributing

  1. Fork and git clone the project
  2. Install dependencies via composer install
  3. Run the tests via composer run tests
  4. Write code and create a PR

Mailing lists

Thank you