Problem/Motivation
PHPStan at level 9 bleeding edge identifies some issues:
------ -------------------------------------------------------------------------
Line web/modules/contrib/firebase_php/src/Form/FirebasePhpConfigurationForm.php
------ -------------------------------------------------------------------------
88 Cannot cast mixed to string.
🪪 cast.string
102 Cannot cast mixed to string.
🪪 cast.string
------ -------------------------------------------------------------------------
------ ------------------------------------------------------------------------------------------------------------------------------
Line web/modules/contrib/firebase_php/src/Form/FirebasePhpSendTestMessageForm.php
------ ------------------------------------------------------------------------------------------------------------------------------
98 Parameter #1 $device_token of method Drupal\firebase_php\FirebasePhpMessagingApiInterface::sendMessageSingleDevice() expects
string, mixed given.
🪪 argument.type
99 Parameter #2 $notification_title of method Drupal\firebase_php\FirebasePhpMessagingApiInterface::sendMessageSingleDevice()
expects string|null, mixed given.
🪪 argument.type
100 Parameter #3 $notification_body of method Drupal\firebase_php\FirebasePhpMessagingApiInterface::sendMessageSingleDevice()
expects string|null, mixed given.
🪪 argument.type
104 Parameter #1 $value of function intval expects array|bool|float|GMP|int|resource|SimpleXMLElement|string|null, mixed given.
🪪 argument.type
110 No error to ignore is reported on line 110.
🪪 ignore.unmatchedLine (non-ignorable)
------ ------------------------------------------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------------------------------
Line web/modules/contrib/firebase_php/src/Form/FirebasePhpValidateTokenForm.php
------ -------------------------------------------------------------------------------------------------------------------------------
78 Call to function array_filter() requires parameter #2 to be passed to avoid loose comparison semantics.
🪪 arrayFilter.strict
78 Cannot cast mixed to string.
🪪 cast.string
78 PHPDoc tag @var with type array<non-empty-string> is not subtype of type array<int<0, max>, non-falsy-string>.
🪪 varTag.type
79 Parameter #1 $registrationTokenOrTokens of method Kreait\Firebase\Contract\Messaging::validateRegistrationTokens() expects
Kreait\Firebase\Messaging\RegistrationToken|Kreait\Firebase\Messaging\RegistrationTokens|list<Kreait\Firebase\Messaging\Regis
trationToken|non-empty-string>|non-empty-string, array<non-empty-string> given.
🪪 argument.type
💡 Type #3 from the union: array<non-empty-string> might not be a list.
94 No error to ignore is reported on line 94.
🪪 ignore.unmatchedLine (non-ignorable)
------ -------------------------------------------------------------------------------------------------------------------------------
------ -------------------------------------------------------------------------------------------------------------------------------
Line web/modules/contrib/firebase_php/src/Service/FirebasePhpMessagingApi.php
------ -------------------------------------------------------------------------------------------------------------------------------
99 Parameter #2 $registrationTokens of method Kreait\Firebase\Contract\Messaging::sendMulticast() expects
Kreait\Firebase\Messaging\RegistrationToken|Kreait\Firebase\Messaging\RegistrationTokens|list<Kreait\Firebase\Messaging\Regis
trationToken|string>|non-empty-string, array given.
🪪 argument.type
💡 Type #3 from the union: array might not be a list.
------ -------------------------------------------------------------------------------------------------------------------------------
------ ---------------------------------------------------------------------------------------------------------------------
Line web/modules/contrib/firebase_php/src/Service/FirebasePhpMessagingService.php
------ ---------------------------------------------------------------------------------------------------------------------
77 Parameter #1 $value of static method Drupal\firebase_php\Enum\LoggingLevel::from() expects int|string, mixed given.
🪪 argument.type
------ ---------------------------------------------------------------------------------------------------------------------
Let's fix these.
Issue fork firebase_php-3590990
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
Comment #4
ptmkenny commentedComment #6
ptmkenny commented