Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
43 | protected function setUp() |
||
44 | { |
||
45 | $sql = file_get_contents(__DIR__ . '/migrations/mysql.sql'); |
||
46 | |||
47 | $statements = array_map('trim', array_filter(explode(";", $sql))); |
||
48 | |||
49 | foreach($statements as $sqlQuery) |
||
50 | { |
||
51 | if(empty($sqlQuery)) { |
||
52 | continue; |
||
53 | } |
||
54 | $query = self::getPdoQueueStoreConnection()->getInstance()->prepare($sqlQuery); |
||
55 | $query->execute(); |
||
56 | } |
||
57 | |||
58 | |||
59 | parent::setUp(); |
||
60 | } |
||
61 | } |
||
62 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: