• Stars
    star
    1,963
  • Rank 23,614 (Top 0.5 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 13 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Primitives for functional programming in PHP

Functional PHP: Functional primitives for PHP

Test

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

More Repositories

1

phpunit-clever-and-smart

Smarter test runner for PHPUnit
PHP
170
star
2

fxmlrpc

A modern, super fast XML/RPC client for PHP >=5.6
PHP
138
star
3

Procrastinator

Execute time consuming tasks as late as possible in a request
PHP
64
star
4

phpunit-function-mocker

Allow mocking otherwise unmockable functions with PHPUnit
PHP
53
star
5

php-cld

PHP bindings for the Chrome Language Detector
PHP
53
star
6

homebridge-prometheus-exporter

Prometheus metrics exporter for homebridge accessories
TypeScript
30
star
7

phpunit-dom-assertions

A work in progress, drop-in replacement for PHPUnit's deprecated DOM assertions.
PHP
29
star
8

pecl-mogilefs

Object-oriented PHP bindings for the MogileFS cluster file system written in C
C
23
star
9

uffff

Unicode input processing made trivial
PHP
19
star
10

prometheus-weathermen

A prometheus exporter for weather data
Rust
15
star
11

hmmmath

Delicious math for PHP
PHP
15
star
12

RuleDSL

PHP
14
star
13

EPHPMVC

A simple, yet very much extendable MVC implementation for PHP 5.3
PHP
10
star
14

ProcrastinatorBundle

Symfony2 integration for Procrastinator
PHP
8
star
15

ObjectConpherter

Object converter for PHP 5.3
PHP
8
star
16

php-nanotime

PHP bindings for libnanotime for nanosecond precision timestamps
C
8
star
17

symfony-reproducible-builds

A demo project to show and test reproducible builds with Symfony
PHP
7
star
18

nanotime

A small C library for nanosecond precise, cross platform timestamps
C
7
star
19

transform54

Transform PHP sources to use new 5.4 features
PHP
3
star
20

class-resolver

Intercepts PHPs "new" operator to execute a callback for name resolval
C
3
star
21

mashup-generator

The hacks that power usrportage.de
PHP
3
star
22

garnix

Nix
2
star
23

kesch

Caching code cata
PHP
2
star
24

prototype.php

Prototypal inheritance in PHP
PHP
2
star
25

.lars

dot-files dump
Shell
1
star
26

maintainer-tools

Random utilities that allow managing multiple OS projects in parallel
PHP
1
star
27

composer-data-donation

Small web form to survey constants and PHP extension info in the wild
HTML
1
star
28

scrypt-api

A convenience wrapper around php-scrypt
PHP
1
star
29

homebridge-ble-thermobeacon

Homebridge integration for Brifit/ORIA thermometer
TypeScript
1
star
30

pistis

Seed based pseudo-randomness generation
PHP
1
star
31

portuportu.com

1
star
32

homebridge-miele

Homebridge support for Miele appliances: https://github.com/nfarina/homebridge
JavaScript
1
star
33

prototype-generator.php

Generates prototypes via reflection for code completion for C extensions or automated wrapper/decorator generation
PHP
1
star
34

dyal

Dynamic asset loader to control loading of CSS and JS files
TypeScript
1
star