Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit a738f29

Browse files
committed
Fix phpdoc errors reported on phpstan level 2 and 3
1 parent a66baa9 commit a738f29

File tree

10 files changed

+63
-56
lines changed

10 files changed

+63
-56
lines changed

src/Message/OptionsBuilder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class OptionsBuilder
5151
/**
5252
* @internal
5353
*
54-
* @var string
54+
* @var int
5555
*/
5656
protected $timeToLive;
5757

@@ -130,7 +130,7 @@ public function setContentAvailable($contentAvailable)
130130
* When a notification is sent and this is set to true,
131131
* the content of the notification can be modified before it is displayed.
132132
*
133-
* @param String $isMutableContent
133+
* @param bool $isMutableContent
134134
* @return OptionsBuilder
135135
*/
136136
public function setMutableContent($isMutableContent)
@@ -323,7 +323,7 @@ public static function getPriorities()
323323
/**
324324
* check if this priority is supported by fcm.
325325
*
326-
* @param $priority
326+
* @param string $priority
327327
*
328328
* @return bool
329329
*

src/Message/PayloadDataBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PayloadDataBuilder
1414
/**
1515
* @internal
1616
*
17-
* @var array
17+
* @var array|null
1818
*/
1919
protected $data;
2020

src/Message/Topics.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ class Topics
2424
*
2525
* @param string $first topicName
2626
*
27-
* @return $this
27+
* @return self
2828
*/
2929
public function topic($first)
3030
{
31-
$this->conditions[] = compact('first');
31+
$this->conditions[] = array(
32+
'first' => $first
33+
);
3234

3335
return $this;
3436
}
@@ -104,18 +106,21 @@ public function andTopic($first)
104106
/**
105107
* @internal
106108
*
107-
* @param $first
108-
* @param $condition
109+
* @param string $first
110+
* @param string $condition
109111
*
110-
* @return $this|Topics
112+
* @return self
111113
*/
112114
private function on($first, $condition)
113115
{
114116
if ($first instanceof Closure) {
115117
return $this->nest($first, $condition);
116118
}
117119

118-
$this->conditions[] = compact('condition', 'first');
120+
$this->conditions[] = array(
121+
'first' => $first,
122+
'condition' => $condition
123+
);
119124

120125
return $this;
121126
}
@@ -124,21 +129,23 @@ private function on($first, $condition)
124129
* @internal
125130
*
126131
* @param Closure $callback
127-
* @param $condition
132+
* @param string $condition
128133
*
129-
* @return $this
134+
* @return self
130135
*/
131136
public function nest(Closure $callback, $condition)
132137
{
133138
$topic = new static();
134139

135140
$callback($topic);
136141
if (count($topic->conditions)) {
137-
$open_parenthesis = '(';
138-
$topic = $topic->conditions;
139-
$close_parenthesis = ')';
140142

141-
$this->conditions[] = compact('condition', 'open_parenthesis', 'topic', 'close_parenthesis');
143+
$this->conditions[] = array(
144+
'condition' => $condition,
145+
'open_parenthesis' => '(',
146+
'topic' => $topic->conditions,
147+
'close_parenthesis' => ')'
148+
);
142149
}
143150

144151
return $this;
@@ -149,7 +156,7 @@ public function nest(Closure $callback, $condition)
149156
*
150157
* @return array|string
151158
*
152-
* @throws NoTopicProvided
159+
* @throws NoTopicProvidedException
153160
*/
154161
public function build()
155162
{
@@ -169,7 +176,7 @@ public function build()
169176
/**
170177
* @internal
171178
*
172-
* @param $conditions
179+
* @param array $conditions
173180
*
174181
* @return string
175182
*/

src/Request/GroupRequest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ class GroupRequest extends BaseRequest
3838
/**
3939
* GroupRequest constructor.
4040
*
41-
* @param $operation
42-
* @param $notificationKeyName
43-
* @param $notificationKey
44-
* @param $registrationIds
41+
* @param string $operation
42+
* @param string $notificationKeyName
43+
* @param string $notificationKey
44+
* @param array $registrationIds
4545
*/
4646
public function __construct($operation, $notificationKeyName, $notificationKey, $registrationIds)
4747
{

src/Request/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Request extends BaseRequest
5050
/**
5151
* Request constructor.
5252
*
53-
* @param $to
53+
* @param string|array $to
5454
* @param Options $options
5555
* @param PayloadNotification $notification
5656
* @param PayloadData $data

src/Response/DownstreamResponse.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DownstreamResponse extends BaseResponse implements DownstreamResponseContr
4848
/**
4949
* @internal
5050
*
51-
* @var
51+
* @var string
5252
*/
5353
protected $messageId;
5454

@@ -97,7 +97,7 @@ class DownstreamResponse extends BaseResponse implements DownstreamResponseContr
9797
* DownstreamResponse constructor.
9898
*
9999
* @param \Psr\Http\Message\ResponseInterface $response
100-
* @param $tokens
100+
* @param array|string $tokens
101101
*/
102102
public function __construct(ResponseInterface $response, $tokens)
103103
{
@@ -109,7 +109,7 @@ public function __construct(ResponseInterface $response, $tokens)
109109
/**
110110
* Parse the response.
111111
*
112-
* @param $responseInJson
112+
* @param array $responseInJson
113113
*/
114114
protected function parseResponse($responseInJson)
115115
{
@@ -127,7 +127,7 @@ protected function parseResponse($responseInJson)
127127
/**
128128
* @internal
129129
*
130-
* @param $responseInJson
130+
* @param array $responseInJson
131131
*/
132132
private function parse($responseInJson)
133133
{
@@ -151,7 +151,7 @@ private function parse($responseInJson)
151151
/**
152152
* @internal
153153
*
154-
* @param $responseInJson
154+
* @param array $responseInJson
155155
*/
156156
private function parseResult($responseInJson)
157157
{
@@ -169,7 +169,7 @@ private function parseResult($responseInJson)
169169
/**
170170
* @internal
171171
*
172-
* @param $responseInJson
172+
* @param array $responseInJson
173173
*
174174
* @return bool
175175
*/
@@ -181,7 +181,7 @@ private function needResultParsing($responseInJson)
181181
/**
182182
* @internal
183183
*
184-
* @param $results
184+
* @param array $results
185185
*
186186
* @return bool
187187
*/
@@ -193,8 +193,8 @@ private function isSent($results)
193193
/**
194194
* @internal
195195
*
196-
* @param $index
197-
* @param $result
196+
* @param string $index
197+
* @param array $result
198198
*
199199
* @return bool
200200
*/
@@ -214,8 +214,8 @@ private function needToBeModify($index, $result)
214214
/**
215215
* @internal
216216
*
217-
* @param $index
218-
* @param $result
217+
* @param string $index
218+
* @param array $result
219219
*
220220
* @return bool
221221
*/
@@ -236,8 +236,8 @@ private function needToBeDeleted($index, $result)
236236
/**
237237
* @internal
238238
*
239-
* @param $index
240-
* @param $result
239+
* @param string $index
240+
* @param array $result
241241
*
242242
* @return bool
243243
*/
@@ -257,7 +257,7 @@ private function needToResend($index, $result)
257257
/**
258258
* @internal
259259
*
260-
* @param $result
260+
* @param array $result
261261
*
262262
* @return bool
263263
*/
@@ -273,8 +273,8 @@ private function checkMissingToken($result)
273273
/**
274274
* @internal
275275
*
276-
* @param $index
277-
* @param $result
276+
* @param string $index
277+
* @param array $result
278278
*/
279279
private function needToAddError($index, $result)
280280
{

src/Response/GroupResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class GroupResponse extends BaseResponse implements GroupResponseContract
4545
* GroupResponse constructor.
4646
*
4747
* @param \Psr\Http\Message\ResponseInterface $response
48-
* @param $to
48+
* @param string $to
4949
*/
5050
public function __construct(ResponseInterface $response, $to)
5151
{
@@ -56,7 +56,7 @@ public function __construct(ResponseInterface $response, $to)
5656
/**
5757
* parse the response.
5858
*
59-
* @param $responseInJson
59+
* @param array $responseInJson
6060
*/
6161
protected function parseResponse($responseInJson)
6262
{
@@ -86,7 +86,7 @@ protected function logResponse()
8686
/**
8787
* @internal
8888
*
89-
* @param $responseInJson
89+
* @param array $responseInJson
9090
*
9191
* @return bool
9292
*/
@@ -105,7 +105,7 @@ private function parse($responseInJson)
105105
/**
106106
* @internal
107107
*
108-
* @param $responseInJson
108+
* @param array $responseInJson
109109
*/
110110
private function parseFailed($responseInJson)
111111
{

src/Response/TopicResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class TopicResponse extends BaseResponse implements TopicResponseContract
1717
/**
1818
* @internal
1919
*
20-
* @var string
20+
* @var Topics
2121
*/
2222
protected $topic;
2323

@@ -57,7 +57,7 @@ public function __construct(ResponseInterface $response, Topics $topic)
5757
/**
5858
* parse the response.
5959
*
60-
* @param $responseInJson
60+
* @param array $responseInJson
6161
*/
6262
protected function parseResponse($responseInJson)
6363
{
@@ -73,7 +73,7 @@ protected function parseResponse($responseInJson)
7373
/**
7474
* @internal
7575
*
76-
* @param $responseInJson
76+
* @param array $responseInJson
7777
*/
7878
private function parseSuccess($responseInJson)
7979
{
@@ -85,7 +85,7 @@ private function parseSuccess($responseInJson)
8585
/**
8686
* @internal
8787
*
88-
* @param $responseInJson
88+
* @param array $responseInJson
8989
*/
9090
private function parseError($responseInJson)
9191
{

src/Sender/FCMGroup.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class FCMGroup extends HTTPSender
1717
/**
1818
* Create a group.
1919
*
20-
* @param $notificationKeyName
21-
* @param array $registrationIds
20+
* @param string $notificationKeyName
21+
* @param array $registrationIds
2222
*
2323
* @return null|string notification_key
2424
*/
@@ -34,9 +34,9 @@ public function createGroup($notificationKeyName, array $registrationIds)
3434
/**
3535
* add registrationId to a existing group.
3636
*
37-
* @param $notificationKeyName
38-
* @param $notificationKey
39-
* @param array $registrationIds registrationIds to add
37+
* @param string $notificationKeyName
38+
* @param string $notificationKey
39+
* @param array $registrationIds registrationIds to add
4040
* @return null|string notification_key
4141
*/
4242
public function addToGroup($notificationKeyName, $notificationKey, array $registrationIds)
@@ -52,9 +52,9 @@ public function addToGroup($notificationKeyName, $notificationKey, array $regist
5252
*
5353
* >Note: if you remove all registrationIds the group is automatically deleted
5454
*
55-
* @param $notificationKeyName
56-
* @param $notificationKey
57-
* @param array $registeredIds registrationIds to remove
55+
* @param string $notificationKeyName
56+
* @param string $notificationKey
57+
* @param array $registeredIds registrationIds to remove
5858
* @return null|string notification_key
5959
*/
6060
public function removeFromGroup($notificationKeyName, $notificationKey, array $registeredIds)

src/Sender/FCMSender.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function sendTo($to, Options $options = null, PayloadNotification $notifi
6363
/**
6464
* Send a message to a group of devices identified with them notification key.
6565
*
66-
* @param $notificationKey
66+
* @param string $notificationKey
6767
* @param Options|null $options
6868
* @param PayloadNotification|null $notification
6969
* @param PayloadData|null $data

0 commit comments

Comments
 (0)