[Vortex] Fix phpstan error about possible undefined variable

Review Request #1037 — Created Oct. 18, 2023 and submitted

pprkut
Lunr.Vortex
d760786...
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 the post() call (while it does for a randomly picked one to check that), which means it detects that somewhere down the stack of post() 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

  • 0
  • 0
  • 0
  • 1
  • 1
Description From Last Updated
b.stoop
  1. 
      
  2. src/Lunr/Vortex/JPush/JPushReport.php (Diff revision 1)
     
     
     
     

    Do we need to get the response? We can get the response code from the exception and the exception has a message we can use

    1. Yeah, we do, becaused DEFERRED depends on a status that is only available in the body

  3. 
      
b.stoop
  1. Ship It!
  2. 
      
pprkut
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release/0.8.x (d760786)
Loading...