Skip to content

Commit e563187

Browse files
Masatoshi OgiwaraMasatoshi Ogiwara
authored andcommitted
feat: chore(add type hint into function argument and return type)
1 parent 0dda3c3 commit e563187

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Job/Message.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
/**
@@ -14,6 +15,7 @@
1415
* @since 0.1.0
1516
* @license https://opensource.org/licenses/MIT MIT License
1617
*/
18+
1719
namespace Cake\Queue\Job;
1820

1921
use Cake\Core\ContainerInterface;
@@ -96,7 +98,7 @@ public function getParsedBody(): array
9698
*
9799
* @return \Closure
98100
*/
99-
public function getCallable()
101+
public function getCallable(): Closure
100102
{
101103
if ($this->callable) {
102104
return $this->callable;
@@ -140,7 +142,7 @@ public function getTarget(): array
140142
* @param mixed $default Default value.
141143
* @return mixed
142144
*/
143-
public function getArgument($key = null, $default = null)
145+
public function getArgument(mixed $key = null, mixed $default = null)
144146
{
145147
if (array_key_exists('data', $this->parsedBody)) {
146148
$data = $this->parsedBody['data'];
@@ -175,7 +177,7 @@ public function getMaxAttempts(): ?int
175177
* @return string
176178
* @psalm-suppress InvalidToString
177179
*/
178-
public function __toString()
180+
public function __toString(): string
179181
{
180182
return (string)json_encode($this);
181183
}
@@ -184,7 +186,7 @@ public function __toString()
184186
* @return array
185187
*/
186188
#[\ReturnTypeWillChange]
187-
public function jsonSerialize()
189+
public function jsonSerialize(): array
188190
{
189191
return $this->parsedBody;
190192
}

0 commit comments

Comments
 (0)