1 | <?php |
||
7 | class Certificate extends ApiResource |
||
8 | { |
||
9 | /** |
||
10 | * Resource type. |
||
11 | * |
||
12 | * @return string |
||
13 | */ |
||
14 | public static function resourceType() |
||
18 | |||
19 | /** |
||
20 | * Resource path (relative to owner or API root). |
||
21 | * |
||
22 | * @return string |
||
23 | */ |
||
24 | public function resourcePath() |
||
28 | |||
29 | /** |
||
30 | * Resource name. |
||
31 | * |
||
32 | * @return string|null |
||
33 | */ |
||
34 | public function name() |
||
38 | |||
39 | /** |
||
40 | * Certificate domain. |
||
41 | * |
||
42 | * @return string|null |
||
43 | */ |
||
44 | public function domain() |
||
48 | |||
49 | /** |
||
50 | * Certificate type. |
||
51 | * |
||
52 | * @return string|null |
||
53 | */ |
||
54 | public function type() |
||
58 | |||
59 | /** |
||
60 | * Request status. |
||
61 | * |
||
62 | * @return string|null |
||
63 | */ |
||
64 | public function requestStatus() |
||
68 | |||
69 | /** |
||
70 | * Determines if certificate is active. |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function active(): bool |
||
78 | |||
79 | /** |
||
80 | * Determines if current certificate was installed from existing certificate. |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function existing(): bool |
||
88 | |||
89 | /** |
||
90 | * Determines if current certificate is Let's Encrypt certificate. |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | public function letsencrypt(): bool |
||
98 | |||
99 | /** |
||
100 | * Get Certificate Signing Request value. |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | public function csr() |
||
110 | |||
111 | /** |
||
112 | * Install certificate. |
||
113 | * |
||
114 | * @param string $content |
||
115 | * @param bool $addIntermediates = false |
||
116 | * |
||
117 | * @return string|null |
||
118 | */ |
||
119 | public function install(string $content, bool $addIntermediates = false): bool |
||
130 | |||
131 | /** |
||
132 | * Activate certificate. |
||
133 | * |
||
134 | * @return bool |
||
135 | */ |
||
136 | public function activate(): bool |
||
142 | } |
||
143 |
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.