Skip to content

Commit 028c5b4

Browse files
committed
Add direct_book_ok parameter for Android configuration
1 parent b5b39e3 commit 028c5b4

29 files changed

+53
-86
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"require-dev": {
2727
"friendsofphp/php-cs-fixer": "^2.5",
28-
"phpstan/phpstan": "^0.11.16",
28+
"phpstan/phpstan": "^0.12",
2929
"phpunit/phpunit": "^7.5"
3030
},
3131
"config": {
@@ -39,7 +39,7 @@
3939
},
4040
"autoload-dev": {
4141
"psr-4": {
42-
"Tests\\Kerox\\Fcm\\": "tests/"
42+
"Kerox\\Fcm\\Tests\\": "tests/"
4343
}
4444
},
4545
"scripts": {

phpstan.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ parameters:
44

55
ignoreErrors:
66
- '#Call to an undefined method GuzzleHttp\\ClientInterface::[a-zA-Z0-9_]+\(\)#'
7+
- '#Method Kerox\\Fcm\\Model\\Message\\[a-zA-z]+::setBody\(\) has no return typehint specified.#'
78

89
fileExtensions:
910
- php
11+
12+
checkMissingIterableValueType: false

src/Api/AbstractApi.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
use GuzzleHttp\ClientInterface;
88

9-
/**
10-
* Class AbstractApi.
11-
*/
129
abstract class AbstractApi
1310
{
1411
/**

src/Api/Send.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
use Kerox\Fcm\Request\SendRequest;
99
use Kerox\Fcm\Response\SendResponse;
1010

11-
/**
12-
* Class Send.
13-
*/
1411
class Send extends AbstractApi
1512
{
1613
public function message(Message $message, bool $validateOnly = false): SendResponse

src/Fcm.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
use GuzzleHttp\ClientInterface;
99
use Kerox\Fcm\Api\Send;
1010

11-
/**
12-
* Class Fcm.
13-
*/
1411
class Fcm
1512
{
1613
public const API_URL = 'https://fcm.googleapis.com/';

src/Model/Message.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
use Kerox\Fcm\Model\Message\Options;
1313
use Kerox\Fcm\Model\Message\Webpush;
1414

15-
/**
16-
* Class Message.
17-
*/
1815
class Message implements \JsonSerializable
1916
{
2017
use UtilityTrait;

src/Model/Message/AbstractNotification.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
namespace Kerox\Fcm\Model\Message;
66

7-
use JsonSerializable;
8-
9-
/**
10-
* Class AbstractNotification.
11-
*/
12-
abstract class AbstractNotification implements NotificationInterface, JsonSerializable
7+
abstract class AbstractNotification implements NotificationInterface, \JsonSerializable
138
{
149
/**
1510
* @var string|null

src/Model/Message/Android.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class Android implements \JsonSerializable
5050
*/
5151
private $options;
5252

53+
/**
54+
* @var bool|null
55+
*/
56+
private $directBootOk;
57+
5358
/**
5459
* @return \Kerox\Fcm\Model\Message\Android
5560
*/
@@ -124,6 +129,16 @@ public function setOptions(AndroidOptions $options): self
124129
return $this;
125130
}
126131

132+
/**
133+
* @return \Kerox\Fcm\Model\Message\Android
134+
*/
135+
public function setDirectBootOk(bool $directBootOk): self
136+
{
137+
$this->directBootOk = $directBootOk;
138+
139+
return $this;
140+
}
141+
127142
public function toArray(): array
128143
{
129144
$array = [
@@ -134,6 +149,7 @@ public function toArray(): array
134149
'data' => $this->data,
135150
'notification' => $this->notification,
136151
'fcm_options' => $this->options,
152+
'direct_boot_ok' => $this->directBootOk,
137153
];
138154

139155
return array_filter($array);

src/Model/Message/Condition.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
use Closure;
88
use Kerox\Fcm\Helper\ValidatorTrait;
99

10-
/**
11-
* Class Condition.
12-
*/
1310
class Condition
1411
{
1512
use ValidatorTrait;

src/Model/Message/Notification.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
namespace Kerox\Fcm\Model\Message;
66

7-
/**
8-
* Class Notification.
9-
*/
107
class Notification extends AbstractNotification
118
{
129
/**

0 commit comments

Comments
 (0)