| Conditions | 5 |
| Paths | 7 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 46 | public function ensureNeededTablesArePresent(array $snippets) |
|
| 30 | { |
||
| 31 | 46 | foreach($snippets as $snippet) |
|
| 32 | { |
||
| 33 | 46 | if(! $snippet instanceof NeedTableAware) |
|
| 34 | 46 | { |
|
| 35 | 3 | throw new \LogicException('Snippet has not expected NeedTableAware type'); |
|
| 36 | } |
||
| 37 | 43 | } |
|
| 38 | |||
| 39 | 43 | foreach($this->neededTableNames as $tableName) |
|
| 40 | { |
||
| 41 | 9 | if(! $this->isAtLeastOneSnippetHasNeededTable($tableName, $snippets)) |
|
| 42 | 9 | { |
|
| 43 | 3 | throw new \LogicException("One of query parts you used needs $tableName table"); |
|
| 44 | } |
||
| 45 | 40 | } |
|
| 46 | 40 | } |
|
| 47 | |||
| 61 |