Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
31 | public function createTable($tableName, $conn = NULL) |
||
32 | { |
||
33 | if (is_null($conn)) { |
||
34 | $conn = $this->dbConn; |
||
35 | } |
||
36 | |||
37 | $sql = 'CREATE TABLE IF NOT EXISTS '.$tableName.'('; |
||
38 | $sql.= ' id INT( 11 ) AUTO_INCREMENT PRIMARY KEY, name VARCHAR( 100 ), gender VARCHAR( 10 ), alias VARCHAR( 150 ) NOT NULL, class VARCHAR( 150 ), stack VARCHAR( 50 ) )'; |
||
39 | |||
40 | return $conn->exec($sql); |
||
41 | |||
42 | throw TableNotCreatedException::create("Check your database connection"); |
||
|
|||
43 | } |
||
44 | |||
46 |
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
,die
orexit
statements that have been added for debug purposes.In the above example, the last
return false
will never be executed, because a return statement has already been met in every possible execution path.