Open
Description
To get offline source inspection (phan, Php Storm, etc.) currently I have to manually type-hint the return-type of getBest()
inline - for example:
$negotiator = new Negotiator();
/** @var Accept $result */
$result = $negotiator->getBest(
$request->getHeaderLine("Accept"),
["application/json", "text/html"]
);
if ($result->getValue() === "application/json") {
// ...
}
Without the @var
annotation, the if
-statement will fail inspection, because the return-type of getBest()
was declared as AcceptHeader
rather than Accept
, which appears to be the actual return-type.
What's the purpose of the empty AcceptHeader
interface?
Metadata
Assignees
Labels
No labels