1.2.1251. Undefined Classes¶
Those classes are used in the code, but there are no definition for them.
This may happens under normal conditions, if the application makes use of an unsupported extension, that defines extra classes; or if some external libraries, such as PEAR, are not provided during the analysis.
This analysis also checks in attributes.
<?php
// FPDF is a classic PDF class, that is usually omitted by Exakat.
$o = new FPDF();
// Exakat reports undefined classes in instanceof
// PHP ignores them
if ($o instanceof SomeClass) {
// doSomething();
}
// Classes may be used in typehint too
function foo(TypeHintClass $x) {
// doSomething();
}
?>
1.2.1251.1. Connex PHP features¶
1.2.1251.1.1. Suggestions¶
Fix the typo in the class name
Add a missing ‘use’ expression
Create the missing class
Added a missing component
1.2.1251.1.2. Specs¶
Short name |
Classes/UndefinedClasses |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Major |
Time To Fix |
Slow (1 hour) |
Precision |
Medium |
Available in |