-
Notifications
You must be signed in to change notification settings - Fork 64
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?
RinkAttendant6, azjezz, willemstuursma, g105b, teohhanhui and 6 more
Metadata
Metadata
Assignees
Labels
No labels