| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 48 | public function __construct($name) |
|
| 34 | { |
||
| 35 | 48 | $allowed = implode('|', $this->commands()); |
|
| 36 | |||
| 37 | 48 | $pattern = '/(' . $allowed . ')_(.*)_table/'; |
|
| 38 | |||
| 39 | 48 | preg_match($pattern, $name, $matches); |
|
| 40 | |||
| 41 | 48 | $this->table = (string) $matches[2]; |
|
| 42 | |||
| 43 | 48 | $this->command = (string) $matches[1]; |
|
| 44 | |||
| 45 | 48 | $pattern = (string) '/(.*)_in_(.*)/'; |
|
| 46 | |||
| 47 | 48 | preg_match($pattern, $matches[2], $matches); |
|
| 48 | |||
| 49 | 48 | if (isset($matches[0])) |
|
| 50 | 16 | { |
|
| 51 | 12 | $this->column = $matches[1]; |
|
| 52 | |||
| 53 | 12 | $this->table = $matches[2]; |
|
| 54 | 4 | } |
|
| 106 |