1.2.289. Could Type With String¶
That argument may be typed with string
.
<?php
// $a is used with a function which requires a string.
function foo($a) {
return strtolower($a);
}
?>
See also Type declarations.
1.2.289.1. Connex PHP features¶
1.2.289.1.1. Suggestions¶
Add the
string
typehint to the function.
1.2.289.1.2. Specs¶
Short name |
Functions/CouldTypeWithString |
Rulesets |
|
Exakat since |
1.9.9 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |