[Vortex] FCM: Throw exception if data value is not a string in the fcm payload

Review Request #1137 — Created April 19, 2024 and submitted

b.stoop
Lunr.Vortex
fcm/checkdatavalues
b965ede...
lunr

Based on master

FCM: Throw exception if data value is not a string in the fcm payload

  • 0
  • 0
  • 4
  • 0
  • 4
Description From Last Updated
There are no open issues
pprkut
  1. 
      
  2. src/Lunr/Vortex/FCM/FCMPayload.php (Diff revision 1)
     
     
    The issue has been resolved. Show all issues

    foreach ($data as &$value)

  3. src/Lunr/Vortex/FCM/FCMPayload.php (Diff revision 1)
     
     
    The issue has been resolved. Show all issues

    === FALSE

  4. src/Lunr/Vortex/FCM/FCMPayload.php (Diff revision 1)
     
     
    The issue has been resolved. Show all issues

    Backticks? We don't use backticks as quotes anywhere else.

    Also, Data type not Data value

  5. 
      
b.stoop
pprkut
  1. 
      
  2. src/Lunr/Vortex/FCM/FCMPayload.php (Diff revisions 1 - 2)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    The issue has been resolved. Show all issues

    array<string,mixed> isn't correct though, because data values are only allowed to be strings.

    phpstan sees that the incoming value, according to phpdoc, is only allowed to be string, so is_string() will always return TRUE.

    I think the better fix here might be to ignore the specific phpstan error using @phpstan-ignore.

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

Status: Closed (submitted)

Change Summary:

Pushed to master (b965ede)
Loading...