digiaonline / notification-wrapper
此软件包已被放弃,不再维护。未建议替代软件包。
通知/消息的超基础包装器
1.0.0
2018-12-12 12:33 UTC
Requires
- php: >=7.1
- ext-json: *
Requires (Dev)
- phpstan/phpstan: ^0.10.6
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2023-03-12 21:34:40 UTC
README
通知/消息的超基础包装器
安装
composer require digiaonline/notification-wrapper
使用方法
// Create a notification $notification = new Notification('TYPE_FOO', ['id' => 1, 'name' => 'John']); // Encode it as JSON (now you can send it somewhere) $json = \json_encode($notification); // Decode the notification on the other end $notification = Notification::fromJson($json); var_dump($notification->getType() === 'TYPE_FOO'); // true var_dump($notification->getPayload() === ['id' => 1, 'name' => 'John']); // true
许可证
MIT