Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
53 | 3 | public function index($key, Operation $operation) |
|
54 | { |
||
55 | 3 | $this->index[$key][$operation->idx($this->connection)] = $operation; |
|
56 | 3 | $indexer = $this; |
|
57 | $operation->onCommit(function ($operation) use ($key, $indexer) { |
||
58 | 1 | $indexer->deIndex($key, $operation); |
|
59 | 3 | }); |
|
60 | 3 | $operation->onRollback(function ($operation) use ($key, $indexer) { |
|
61 | 1 | $indexer->deIndex($key, $operation); |
|
62 | 3 | }); |
|
63 | 3 | return $operation; |
|
64 | } |
||
65 | |||
97 |