1 | <?php |
||
18 | class Session implements SessionInterface |
||
19 | { |
||
20 | /** |
||
21 | * Session. |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $session = []; |
||
26 | |||
27 | /** |
||
28 | * File. |
||
29 | * |
||
30 | * @var File |
||
31 | */ |
||
32 | protected $file; |
||
33 | |||
34 | /** |
||
35 | * User. |
||
36 | * |
||
37 | * @var User |
||
38 | */ |
||
39 | protected $user; |
||
40 | |||
41 | /** |
||
42 | * Session. |
||
43 | */ |
||
44 | public function __construct(File $file, User $user, array $session) |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function getUser(): User |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function getFile(): File |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function getAccessTokenTTl(): int |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function getAccessToken(): string |
||
82 | |||
83 | /** |
||
84 | * Get wopi url. |
||
85 | */ |
||
86 | public function getWopiUrl(): string |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function getAttributes(): array |
||
136 | } |
||
137 |
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.