| Conditions | 1 |
| Paths | 1 |
| Total Lines | 40 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace norsys\score\trampoline\container; |
||
| 25 | function argumentsForBlockAre(block $block, ... $arguments) :void |
||
| 26 | { |
||
| 27 | $nothing = function() {}; |
||
| 28 | $callBlock = function() use ($block, & $arguments) { |
||
| 29 | $block->blockArgumentsAre(... $arguments); |
||
| 30 | }; |
||
| 31 | $do = $callBlock; |
||
| 32 | |||
| 33 | ( |
||
| 34 | new iterator\fifo |
||
| 35 | ) |
||
| 36 | ->variablesForIteratorBlockAre( |
||
| 37 | new functor( |
||
| 38 | function($iterator, $trampoline) use ($nothing, $callBlock, & $do, & $arguments) |
||
| 39 | { |
||
| 40 | $iterator->nextIterationAreUseless(); |
||
| 41 | |||
| 42 | $do = $nothing; |
||
| 43 | |||
| 44 | $trampoline |
||
| 45 | ->argumentsForBlockAre( |
||
| 46 | new block\functor( |
||
| 47 | function(... $argumentsFromTrampoline) use ($iterator, $callBlock, &$do, & $arguments) { |
||
| 48 | $arguments = array_merge($arguments, $argumentsFromTrampoline); |
||
| 49 | |||
| 50 | $do = $callBlock; |
||
| 51 | |||
| 52 | $iterator->nextIterationAreUsefull(); |
||
| 53 | } |
||
| 54 | ), |
||
| 55 | ... $arguments |
||
| 56 | ) |
||
| 57 | ; |
||
| 58 | } |
||
| 59 | ), |
||
| 60 | ... $this->trampolines |
||
| 61 | ) |
||
| 62 | ; |
||
| 63 | |||
| 64 | $do(); |
||
| 65 | } |
||
| 67 |