| 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 \Closure $f |
||
| 18 | */ |
||
| 19 | protected function __construct(\Closure $f) |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Invoke the stored function with the stored arguments. |
||
| 26 | * |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function __invoke() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @param \Closure $f |
||
| 49 | * @return callable |
||
| 50 | */ |
||
| 51 | public static function get(\Closure $f) |
||
| 55 | } |
||
| 56 |