| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public static function get($type, $config) |
||
| 33 | { |
||
| 34 | $instance = null; |
||
|
|
|||
| 35 | $options = []; |
||
| 36 | |||
| 37 | switch ($type) { |
||
| 38 | |||
| 39 | case 'doctrine': |
||
| 40 | $instance = new Adapter\DoctrineAdapter($options); |
||
| 41 | $instance->em = self::$em; |
||
| 42 | break; |
||
| 43 | |||
| 44 | case 'amqp': |
||
| 45 | $instance = new Adapter\AmqpAdapter($config['amqp_connection']); |
||
| 46 | break; |
||
| 47 | |||
| 48 | default: |
||
| 49 | throw new InvalidAdapterDefinitionException(); |
||
| 50 | } |
||
| 51 | |||
| 52 | return $instance; |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.