| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) |
||
| 19 | { |
||
| 20 | throw new \Exception('Set type is not supported'); |
||
| 21 | // we're going to store SET values in the comment since DBAL doesn't support |
||
| 22 | $allowed = explode(',', trim($fieldDeclaration['comment'])); |
||
|
|
|||
| 23 | |||
| 24 | $pdo = DB::connection()->getPdo(); |
||
| 25 | |||
| 26 | // trim the values |
||
| 27 | $fieldDeclaration['allowed'] = array_map(function ($value) use ($pdo) { |
||
| 28 | return $pdo->quote(trim($value)); |
||
| 29 | }, $allowed); |
||
| 30 | |||
| 31 | return 'set('.implode(', ', $fieldDeclaration['allowed']).')'; |
||
| 32 | } |
||
| 34 |
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return,dieorexitstatements that have been added for debug purposes.In the above example, the last
return falsewill never be executed, because a return statement has already been met in every possible execution path.