It seems like $job defined by $job ?: $this->job on line 44 can also be of type object<Jobs\Entity\Decorator\JsonLdProvider>; however, Jobs\Entity\Decorator\Js...Provider::__construct() does only seem to accept object<Jobs\Entity\JobInterface>, maybe add an additional type check?
If a method or function can return multiple different values and unless you are
sure that you only can receive a single value in this context, we recommend
to add an additional type check:
/** * @return array|string */functionreturnsDifferentValues($x){if($x){return'foo';}returnarray();}$x=returnsDifferentValues($y);if(is_array($x)){// $x is an array.}
If this a common case that PHP Analyzer should handle natively, please let us
know by opening an issue.
Loading history...
51
52
return '<script type="application/ld+json">'
53
. $jsonLdProvider->toJsonLd()
54
. '</script>';
55
56
}
57
58
/**
59
* Set the default job to use, if invoked without arguments.
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.