1 | <?php |
||
9 | abstract class ExtendedServer |
||
10 | { |
||
11 | protected $host; |
||
12 | protected $port; |
||
13 | protected $user; |
||
14 | protected $password; |
||
15 | protected $dbname; |
||
16 | protected $extraParams = []; |
||
17 | protected $driver; |
||
18 | protected $driverOptions; |
||
19 | |||
20 | /** |
||
21 | * @var Connection |
||
22 | */ |
||
23 | protected $connection; |
||
24 | |||
25 | public function __construct(array $params) |
||
45 | |||
46 | public function dbalConfig(): array { |
||
57 | |||
58 | public function isConnected(): bool { |
||
61 | |||
62 | public function __toString() |
||
66 | |||
67 | public function close() { |
||
73 | |||
74 | /** |
||
75 | * @return \Doctrine\DBAL\Connection |
||
76 | * @throws \Doctrine\DBAL\DBALException |
||
77 | */ |
||
78 | public function connection(): Connection { |
||
84 | |||
85 | public function __destruct() |
||
89 | } |
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.