The expression $this->matchTypes($param...meter['name']] ?? null) of type boolean|null is loosely compared to false; this is ambiguous if the boolean can be false. You might want to explicitly use !== null instead.
If an expression can have both false, and null as possible values. It
is generally a good practice to always use strict comparison to clearly
distinguish between those two values.
$a=canBeFalseAndNull();// Instead ofif(!$a){}// Better use one of the explicit versions:if($a!==null){}if($a!==false){}if($a!==null&&$a!==false){}
Loading history...
31
throw new NotMatchedException("The formData parameter '{$parameter['name']}' not match with the specification");
32
}
33
}
34
}
35
36
if (!empty($body) && !$hasFormData) {
37
throw new InvalidDefinitionException('Body is passed but there is no request body definition');
If an expression can have both
false
, andnull
as possible values. It is generally a good practice to always use strict comparison to clearly distinguish between those two values.