The expression $handled 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...
49
{
50
$params = [];
51
if(!empty($parent) && is_object($parent))
52
{
53
$params[] = sprintf('on model `%s`', get_class($parent));
54
}
55
if(!empty($parentField))
56
{
57
$params[] = sprintf('on field `%s`', $parentField);
58
}
59
throw new TransformatorException('Could not determine document type ' . implode(', ', $params));
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.