1.2.284. Could Type With Boolean

That argument, property or method may be typed with bool. Based on usage, it was determined that the only type possible is a boolean.

<?php

// $a is used with a function which requires a boolean.
function foo($code, $a) {
    return var_dump($code, $a);
}

?>

See also Type declarations.

1.2.284.1. Suggestions

  • Add the bool typehint to the function.

1.2.284.2. Specs

Short name

Functions/CouldTypeWithBool

Rulesets

All

Exakat since

1.9.9

PHP Version

All

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Features

typehint

Available in

Entreprise Edition, Exakat Cloud