1.2.1447. Wrong Class Name Case¶
The spotted classes are used with a different case than their definition. While PHP accepts this, it makes the code harder to read.
It may also be a violation of coding conventions.
<?php
// This use statement has wrong case for origin.
use Foo as X;
// Definition of the class
class foo {}
// Those instantiations have wrong case
new FOO();
new X();
?>
See also PHP class name constant case sensitivity and PSR-11.
1.2.1447.1. Connex PHP features¶
1.2.1447.1.1. Suggestions¶
Match the defined class name with the called name
1.2.1447.1.2. Specs¶
Short name |
Classes/WrongCase |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Instant (5 mins) |
Precision |
High |
Examples |
|
Available in |