serafim / placeholder
This package is abandoned and no longer maintained.
The author suggests using the phpfn/placeholder package instead.
Simple placeholder implementation for functional constructions
1.0.0
2019-07-04 19:24 UTC
Requires
- php: >=7.1.3
- serafim/symbol: ~1.0
Requires (Dev)
- phpunit/phpunit: ~7.5
This package is auto-updated.
Last update: 2020-08-08 23:35:07 UTC
README
Placeholder
Library provides a placeholder implementation for currying functions, partial applications, pipe operator, and other syntactic structures hat allow specifying default values.
Usage
What is "placeholder"?
<?php var_dump(is_placeholder('_')); // expected output: false var_dump(is_placeholder(_)); // expected output: true
For example we can replace each of the placeholders in the array with the required value.
<?php use Serafim\Placeholder\Placeholder; $array = [1, _, 3, _]; $result = Placeholder::map($array, fn() => ' map '); echo implode(', ', $result); // expected output: "1, map, 3, map"
And... Thats all =)