Skip to content

MIR0225

ArgumentTypeCoercion

An argument’s type had to be widened/coerced to match the parameter’s declared type.

<?php
function f(Child $c){}
/** @param Parent $p */ function g($p){ f($p); }

Pass a value of the exact expected type, or narrow first.