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