1.2.1433. Wrong Argument Type

Checks that the type of the argument is consistent with the type of the called method.

This analysis is valid with PHP 8.0.

<?php

function foo(int $a) { }

//valid call, with an integer
foo(1);

//invalid call, with a string
foo('asd');

?>

1.2.1433.1. Suggestions

  • Always use a valid type when calling methods.

1.2.1433.2. Specs

Short name

Functions/WrongArgumentType

Rulesets

All, Analyze, Typechecks

Exakat since

2.1.3

PHP Version

With PHP 8.0 and more recent

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud