1.2.261. Could Be Parent¶
Mark arguments, return types and properties that can be set to parent
.
This analysis works when typehints have already been configured.
<?php
class x extends w {
// Accept a w object as input
function foo(w $b) : w {
// Returns a w object
return $b;
}
}
?>
1.2.261.1. Connex PHP features¶
1.2.261.1.1. Suggestions¶
Add parent typehint to the code.
Add the literal class/type typehint to the code.
1.2.261.1.2. Specs¶
Short name |
Typehints/CouldBeParent |
Rulesets |
|
Exakat since |
2.1.2 |
PHP Version |
All |
Severity |
Major |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |