| Conditions | 5 |
| Paths | 5 |
| Total Lines | 30 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 19 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 43 | 15 | public function execute(QueryInterface $query) |
|
| 44 | { |
||
| 45 | 15 | $builder = $query->instance(); |
|
| 46 | |||
| 47 | 15 | if ($query->type() === QueryInterface::TYPE_SELECT) |
|
| 48 | 10 | { |
|
| 49 | 6 | $this->result = $builder->get(); |
|
| 50 | |||
| 51 | 6 | return $this; |
|
| 52 | } |
||
| 53 | |||
| 54 | 9 | $bindings = $query->bindings(); |
|
| 55 | |||
| 56 | 9 | switch ($query->type()) |
|
| 57 | { |
||
| 58 | 9 | case QueryInterface::TYPE_INSERT: |
|
| 59 | 3 | $this->affected = $builder->insert($bindings); |
|
| 60 | |||
| 61 | 3 | break; |
|
| 62 | 6 | case QueryInterface::TYPE_UPDATE: |
|
| 63 | 3 | $this->affected = $builder->update($bindings); |
|
| 64 | |||
| 65 | 3 | break; |
|
| 66 | 3 | case QueryInterface::TYPE_DELETE: |
|
| 67 | 3 | $this->affected = $builder->delete($bindings); |
|
| 68 | |||
| 69 | 3 | break; |
|
| 70 | 6 | } |
|
| 71 | |||
| 72 | 9 | return $this; |
|
| 73 | } |
||
| 95 |