Problem/Motivation

phpstan identifies some issues:


 ------ ------------------------------------------------------------------------------------------------------------------------------
  Line   web/modules/contrib/apns_php/src/Form/ApnsPhpSendTestMessageForm.php
 ------ ------------------------------------------------------------------------------------------------------------------------------
  98     Parameter #1 $device_token of method Drupal\apns_php\ApnsPhpMessagingApiInterface::sendMessageSingleDevice() expects string,
         mixed given.
         🪪  argument.type
  99     Parameter #2 $notification_title of method Drupal\apns_php\ApnsPhpMessagingApiInterface::sendMessageSingleDevice() expects
         string|null, mixed given.
         🪪  argument.type
  100    Parameter #3 $notification_body of method Drupal\apns_php\ApnsPhpMessagingApiInterface::sendMessageSingleDevice() expects
         string|null, mixed given.
         🪪  argument.type
  102    Parameter #1 $value of function intval expects array|bool|float|GMP|int|resource|SimpleXMLElement|string|null, mixed given.
         🪪  argument.type
  108    No error to ignore is reported on line 108.
         🪪  ignore.unmatchedLine (non-ignorable)
 ------ ------------------------------------------------------------------------------------------------------------------------------

 ------ -------------------------------------------------------------------
  Line   web/modules/contrib/apns_php/src/Service/ApnsPhpMessagingService.php
 ------ -------------------------------------------------------------------
  97     Cannot cast mixed to string.
         🪪  cast.string
 ------ -------------------------------------------------------------------

Let's fix these.

Issue fork apns_php-3590988

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Title: Increase phpstan strictness » Fix phpstan type-safety errors

ptmkenny’s picture

Issue summary: View changes

  • ptmkenny committed fd7bf990 on 1.0.x
    task: #3590988 Fix phpstan type-safety errors
    
    By: ptmkenny
    
ptmkenny’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.