| 1 | <?php |
||
| 5 | class Pool |
||
| 6 | { |
||
| 7 | /** @var callable|\Closure $f */ |
||
| 8 | private $f; |
||
| 9 | |||
| 10 | /** @var array $arguments_pool */ |
||
| 11 | private $arguments_pool = []; |
||
| 12 | |||
| 13 | /** @var bool currently recursing */ |
||
| 14 | private $recursing = false; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param callable $f |
||
| 18 | */ |
||
| 19 | protected function __construct(callable $f) |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Invoke the stored function with the stored arguments. |
||
| 32 | * |
||
| 33 | * @return mixed |
||
| 34 | */ |
||
| 35 | public function __invoke() |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param callable $f |
||
| 55 | * @return callable |
||
| 56 | */ |
||
| 57 | public static function get(callable $f) |
||
| 61 | } |
||
| 62 |