[Vortex] Fix phpstan error about possible undefined variable
Review Request #1037 — Created Oct. 18, 2023 and submitted — Latest diff uploaded
Information | |
---|---|
pprkut | |
Lunr.Vortex | |
d760786... | |
Reviewers | |
lunr | |
Adding @throws did, contrary to expectations, not help here.
phpstan also doesn't detect that RequestsExceptionHTTP is a useless catch when limiting the try-catch block on thepost()
call (while it does for a randomly picked one to check that), which means it detects that somewhere down the stack ofpost()
a Http exception is thrown.Therefore, rather than working with the local
$response
, fetch the Response class the Exception was thrown from (data
for a Http exception seems to always be a Response object, though no type-safety for that so far).
GitHub actions run: https://github.com/pprkut/lunr.vortex/actions/runs/6560049049