| Conditions | 6 |
| Paths | 9 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6.2163 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | 52 | public function executeCreateCommand($command) |
|
| 33 | { |
||
| 34 | 52 | if ($this->connection->pretending()) { |
|
| 35 | $this->connection->logQuery('/* ' . $command->explanation . " */\n", []); |
||
| 36 | |||
| 37 | return; |
||
| 38 | } |
||
| 39 | 52 | $options = $command->options; |
|
| 40 | |||
| 41 | 52 | if ($this->keyGenerator !== 'traditional') { |
|
| 42 | 4 | $options['keyOptions']['type'] = $this->keyGenerator; |
|
| 43 | } |
||
| 44 | |||
| 45 | 52 | if ($this->keyGenerator === 'autoincrement' && $this->incrementOffset !== 0) { |
|
| 46 | 1 | $options['keyOptions']['offset'] = $this->incrementOffset; |
|
| 47 | } |
||
| 48 | |||
| 49 | 52 | if (!$this->schemaManager->hasCollection($this->table)) { |
|
| 50 | 51 | $this->schemaManager->createCollection($this->table, $options); |
|
| 51 | } |
||
| 54 |