-
-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad phpstan documentation for WebPushNotificationShape #893
Comments
Thank you for the report, I'll look into it. Could you please update your message and replace "Last Version" with the actual version you have installed? |
You said "With this shape, it doesn't work" - could you give me an example of a shape that doesn't work? |
Ty. Sure ! Phpstan excepts this shape : $message = CloudMessage::new()
->withWebPushConfig(WebPushConfig::fromArray([
'notification' => [
'title' => 'title',
'options' => [
'body' => 'body',
]
],
])); But it's wrong. $message = CloudMessage::new()
->withWebPushConfig(WebPushConfig::fromArray([
'notification' => [
'title' => 'title',
'body' => 'body',
],
])); For information, I've tested these parameters which work on chrome mobile (android) and dekstop (windows). $message = CloudMessage::new()
->withNotification(['title' => 'Notification title', 'body' => 'Notification body'])
->withWebPushConfig(WebPushConfig::fromArray([
'notification' => [
'title' => 'title',
'body' => 'body',
'icon' => '/uploads/files/662f9d3ca6a9c166680163.png',
'badge' => '/uploads/files/662f9d3ca6a9c166680163.png',
'image' => '/uploads/files/662f9d3ca6a9c166680163.png',
'actions' => [
['action' => 'testaction', 'title' => 'Title action', 'icon' => '/uploads/files/662f9d3ca6a9c166680163.png']
]
],
])); |
Could you please confirm if #895 works as expected, and comment on the PR if yes or no? Thanks! |
It's better but not perfect in my opinion. :) I don't know which is the good solution....
Does not work : $message = CloudMessage::new()
->withWebPushConfig(WebPushConfig::fromArray([
'notification' => [
'title' => $pushNotificationMessage->title, Works : $message = CloudMessage::new()
->withWebPushConfig(WebPushConfig::fromArray([
'notification' => [
'title' => 'title',
I think we can validate this modification. The old one was wrong. |
If the object providing the Let me know if this works better for you. |
With this "non-empty-string" directive, I have to change everywhere the type of my properties. Overthise, I got this phpstan error :
But I don't know what is the best approach... |
Could we please continue the discussion on the PR, where the work is done? I already removed the |
Describe the bug
Hello,
Phpstan documentation is :
With this shape, it does not work.
I have to use :
It's a problem because if I don't use the documentated shape, PHPStan is not happy.
Ty
Installed packages
PHP version and extensions
Steps to reproduce the issue.
Error message/Stack trace
Additional information
No response
The text was updated successfully, but these errors were encountered: