1.2.287. 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.287.1. Suggestions

  • Add the string typehint to the function.

1.2.287.2. Specs

Short name

Functions/CouldTypeWithString

Rulesets

All

Exakat since

1.9.9

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Features

string

Available in

Entreprise Edition, Exakat Cloud