| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 7 | public function process(ResultInterface $result) |
|
| 27 | { |
||
| 28 | 7 | $result->setActionStartTime($this->getCode(), new \DateTime()); |
|
| 29 | 7 | foreach ($this->bag as $unit) { |
|
| 30 | 7 | if ($unit->getTmpTable() === null) { |
|
| 31 | 1 | throw new WrongContextException(sprintf( |
|
| 32 | 1 | "Action can not be used for current unit %s. Tmp table is missing.", |
|
| 33 | 1 | $unit->getCode() |
|
| 34 | 1 | )); |
|
| 35 | } |
||
| 36 | 6 | $moved = $this->resource->move($unit->getTmpTable(), $unit->getTable(), array_keys($unit->getMapping())); |
|
| 37 | 6 | $result->incrementActionProcessed($this->getCode(), $moved); |
|
| 38 | 6 | } |
|
| 39 | 6 | $result->setActionEndTime($this->getCode(), new \DateTime()); |
|
| 40 | 6 | } |
|
| 41 | |||
| 50 |