1 | <?php |
||
10 | class ZohoSyncSQLLogger implements SQLLogger |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @var LoggerInterface |
||
15 | */ |
||
16 | private $logger; |
||
17 | |||
18 | /** |
||
19 | * @var Connection |
||
20 | */ |
||
21 | private $connection; |
||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | private $authorizedSQLWithoutParams; |
||
26 | /** |
||
27 | * @var bool |
||
28 | */ |
||
29 | private $authorizedSQLWithParams; |
||
30 | |||
31 | /** |
||
32 | * ZohoSyncSQLLogger constructor. |
||
33 | * @param LoggerInterface $logger |
||
34 | * @param Connection $connection |
||
35 | * @param bool $authorizedSQLWithoutParams |
||
36 | * @param bool $authorizedSQLWithParams |
||
37 | */ |
||
38 | public function __construct(LoggerInterface $logger, Connection $connection, $authorizedSQLWithoutParams = false, $authorizedSQLWithParams = false) |
||
45 | |||
46 | /** |
||
47 | * Logs a SQL statement somewhere. |
||
48 | * |
||
49 | * @param string $sql The SQL to be executed. |
||
50 | * @param array|null $params The SQL parameters. |
||
51 | * @param array|null $types The SQL parameter types. |
||
52 | * |
||
53 | * @return void |
||
54 | */ |
||
55 | public function startQuery($sql, array $params = null, array $types = null) |
||
64 | |||
65 | /** |
||
66 | * Marks the last started query as stopped. This can be used for timing of queries. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | public function stopQuery() |
||
73 | } |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.