1.2.1292. Unused Class Constant¶
The class constant is unused. Consider removing it or using it.
Class constants may be used in expressions, in static expressions, when building other constants, or in default values.
<?php
class foo {
public const UNUSED = 1; // No mention in the code
private const USED = 2; // used constant
function bar() {
echo self::USED;
}
}
?>
1.2.1292.1. Connex PHP features¶
1.2.1292.1.1. Suggestions¶
Remove the class constant
Use the class constant
1.2.1292.1.2. Specs¶
Short name |
Classes/UnusedConstant |
Rulesets |
|
Exakat since |
1.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |