| 1 | <?php |
||
| 7 | class PathTracer |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Disable new operations when set |
||
| 11 | * |
||
| 12 | * @var bool |
||
| 13 | */ |
||
| 14 | private $done = false; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Store segments of scripts |
||
| 18 | * |
||
| 19 | * @var OperationContainer[] |
||
| 20 | */ |
||
| 21 | private $segments = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Temporary storage for current segment |
||
| 25 | * |
||
| 26 | * @var Operation[] |
||
| 27 | */ |
||
| 28 | private $current = []; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Make a segment from whatever's in current |
||
| 32 | */ |
||
| 33 | private function makeSegment() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Add an operation to current segment |
||
| 41 | * @param Operation $operation |
||
| 42 | */ |
||
| 43 | private function addToCurrent(Operation $operation) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param Operation $operation |
||
| 50 | */ |
||
| 51 | public function operation(Operation $operation) |
||
| 69 | |||
| 70 | /** |
||
| 71 | * @return PathTrace |
||
| 72 | */ |
||
| 73 | public function done() |
||
| 87 | } |
||
| 88 |