[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).

  • 0
  • 0
  • 0
  • 1
  • 1
Description From Last Updated
There are no open issues
b.stoop
  1. 
      
  2. src/Lunr/Vortex/JPush/JPushReport.php (Diff revision 1)
     
     
     
     
    The issue has been dropped. Show all issues

    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...