1 | <?php |
||
15 | class ObjectRepository implements StorageInterface |
||
16 | { |
||
17 | /** @var AuthenticationOptions */ |
||
18 | protected $options; |
||
19 | |||
20 | /** |
||
21 | * @param mixed[]|AuthenticationOptions $options |
||
22 | */ |
||
23 | 4 | public function setOptions($options) : ObjectRepository |
|
33 | |||
34 | /** |
||
35 | * Constructor |
||
36 | * |
||
37 | * @param mixed[]|AuthenticationOptions $options |
||
38 | */ |
||
39 | 4 | public function __construct($options = []) |
|
43 | |||
44 | 1 | public function isEmpty() : bool |
|
48 | |||
49 | /** |
||
50 | * This function assumes that the storage only contains identifier values (which is the case if |
||
51 | * the ObjectRepository authentication adapter is used). |
||
52 | */ |
||
53 | 1 | public function read() : ?object |
|
62 | |||
63 | /** |
||
64 | * Will return the key of the identity. If only the key is needed, this avoids an |
||
65 | * unnecessary db call |
||
66 | * |
||
67 | * @return mixed |
||
68 | */ |
||
69 | 1 | public function readKeyOnly() |
|
73 | |||
74 | /** |
||
75 | * @param mixed $identity |
||
76 | */ |
||
77 | 1 | public function write($identity) : void |
|
84 | |||
85 | public function clear() : void |
||
89 | } |
||
90 |
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.