Skip to content

Commit edb6105

Browse files
committed
PHPStan level 8
1 parent c5b5b18 commit edb6105

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Coverage Status](https://img.shields.io/codecov/c/github/cakephp/queue/master.svg?style=flat-square)](https://codecov.io/github/cakephp/queue?branch=master)
66
[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/queue.svg?style=flat-square)](https://packagist.org/packages/cakephp/queue)
77

8-
This is a Queue system for CakePHP 4.
8+
This is a Queue system for CakePHP.
99

1010
The plugin consists of a CakePHP shell wrapper and Queueing libraries for the [php-queue](https://php-enqueue.github.io) queue library.
1111

@@ -34,7 +34,7 @@ bin/cake plugin load Cake/Queue
3434

3535
Or you can manually add the loading statement in the **src/Application.php** file of your application:
3636
```php
37-
public function bootstrap()
37+
public function bootstrap(): void
3838
{
3939
parent::bootstrap();
4040
$this->addPlugin('Cake/Queue');

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
],
5353
"cs-check": "phpcs --colors -p src/ tests/",
5454
"cs-fix": "phpcbf --colors -p src/ tests/",
55-
"stan": "phpstan analyse src/ && psalm.phar --show-info=false",
55+
"stan": "phpstan analyse && psalm.phar --show-info=false",
5656
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan:^1.5 psalm/phar:~4.22 && mv composer.backup composer.json",
5757
"test": "phpunit",
5858
"test-coverage": "phpunit --coverage-clover=clover.xml"

phpstan.neon

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
parameters:
2-
level: 6
2+
level: 8
33
checkMissingIterableValueType: false
4+
checkGenericClassInNonGenericObjectType: false
45
bootstrapFiles:
56
- tests/bootstrap.php
67
paths:
78
- src/
9+
ignoreErrors:
10+
- '#Parameter \#1 \$callback of static method Closure::fromCallable\(\) expects callable\(\): mixed, array\{mixed, string\} given.#'
11+
- '#Method Cake\\Queue\\Job\\Message::getTarget\(\) should return array\{class-string, string\} but returns non-empty-array.#'

src/Job/Message.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public function getCallable()
122122
*/
123123
public function getTarget(): array
124124
{
125+
/** @var array|null $target */
125126
$target = $this->parsedBody['class'] ?? null;
126127

127128
if (!is_array($target) || count($target) !== 2) {
@@ -176,7 +177,7 @@ public function getMaxAttempts(): ?int
176177
*/
177178
public function __toString()
178179
{
179-
return json_encode($this);
180+
return (string)json_encode($this);
180181
}
181182

182183
/**

src/Listener/FailedJobsListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function implementedEvents(): array
3838
}
3939

4040
/**
41-
* @param object $event EventInterface.
41+
* @param \Cake\Event\EventInterface $event EventInterface.
4242
* @return void
4343
*/
4444
public function storeFailedJob($event): void

0 commit comments

Comments
 (0)