diff --git a/src/Job/Message.php b/src/Job/Message.php index 66c731e..02552c6 100644 --- a/src/Job/Message.php +++ b/src/Job/Message.php @@ -96,7 +96,7 @@ public function getParsedBody(): array * * @return \Closure */ - public function getCallable() + public function getCallable(): Closure { if ($this->callable) { return $this->callable; @@ -140,7 +140,7 @@ public function getTarget(): array * @param mixed $default Default value. * @return mixed */ - public function getArgument($key = null, $default = null) + public function getArgument(mixed $key = null, mixed $default = null) { if (array_key_exists('data', $this->parsedBody)) { $data = $this->parsedBody['data']; @@ -175,7 +175,7 @@ public function getMaxAttempts(): ?int * @return string * @psalm-suppress InvalidToString */ - public function __toString() + public function __toString(): string { return (string)json_encode($this); } @@ -184,7 +184,7 @@ public function __toString() * @return array */ #[\ReturnTypeWillChange] - public function jsonSerialize() + public function jsonSerialize(): array { return $this->parsedBody; } diff --git a/tests/TestCase/Job/MessageTest.php b/tests/TestCase/Job/MessageTest.php index e828814..47e56c3 100644 --- a/tests/TestCase/Job/MessageTest.php +++ b/tests/TestCase/Job/MessageTest.php @@ -31,7 +31,7 @@ class MessageTest extends TestCase * * @return void */ - public function testConstructorAndGetters() + public function testConstructorAndGetters(): void { $callable = ['TestApp\WelcomeMailer', 'welcome']; $time = 'sample data ' . time(); @@ -69,7 +69,7 @@ public function testConstructorAndGetters() * * @return void */ - public function testLegacyArguments() + public function testLegacyArguments(): void { $callable = ['TestApp\WelcomeMailer', 'welcome']; $args = [ @@ -98,7 +98,7 @@ public function testLegacyArguments() * * @return void */ - public function testGetCallableInvalidClass() + public function testGetCallableInvalidClass(): void { $parsedBody = [ 'class' => ['Trash', 'trash'], @@ -120,7 +120,7 @@ public function testGetCallableInvalidClass() * * @return void */ - public function testGetCallableInvalidType() + public function testGetCallableInvalidType(): void { $parsedBody = [ 'class' => ['TestApp\WelcomeMailer', 'trash', 'oops'],