This library contains functional utilities intended for use with PHP 8.4 and later. Its primary tool is the pipe()
function, which takes a starting argument and then a series of callables to "pipe" that argument through. Most other functions are utilities that produce a closure that takes the return from a previous pipe()
step as its only argument.
Requires PHP 8.4+
composer require cline/fp
- Pipes and Composition - Introduction to
pipe()
andcompose()
functions - Pipeable Functions - Understanding partially applied functions
- String Functions - String manipulation utilities
- Object Functions - Object property and method utilities
- Array Functions - Comprehensive array operations (map, filter, reduce, etc.)
- Utility Traits -
Evolvable
andNewable
traits for functional object patterns - Examples - Real-world usage examples and patterns
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.
The MIT License. Please see License File for more information.