Skip to content

Commit b20275f

Browse files
committed
update stan
1 parent ecf7435 commit b20275f

File tree

9 files changed

+17
-49
lines changed

9 files changed

+17
-49
lines changed

.phive/phars.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="phpstan" version="1.10.56" installed="1.10.56" location="./tools/phpstan" copy="false"/>
4-
<phar name="psalm" version="5.20.0" installed="5.20.0" location="./tools/psalm" copy="false"/>
3+
<phar name="phpstan" version="2.1.17" installed="2.1.17" location="./tools/phpstan" copy="false"/>
54
</phive>

composer.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,9 @@
6161
],
6262
"cs-check": "phpcs --colors -p src/ tests/",
6363
"cs-fix": "phpcbf --colors -p src/ tests/",
64-
"stan": [
65-
"@phpstan",
66-
"@psalm"
67-
],
64+
"stan": "@phpstan",
6865
"phpstan": "tools/phpstan analyse",
69-
"psalm": "tools/psalm --show-info=false",
7066
"stan-baseline": "tools/phpstan --generate-baseline",
71-
"psalm-baseline": "tools/psalm --set-baseline=psalm-baseline.xml",
7267
"stan-setup": "phive install",
7368
"test": "phpunit",
7469
"test-coverage": "phpunit --coverage-clover=clover.xml"

phpstan-baseline.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Parameter \#1 \$callback of static method Closure\:\:fromCallable\(\) expects callable\(\)\: mixed, array\{mixed, string\} given\.$#'
5+
identifier: argument.type
6+
count: 1
7+
path: src/Job/Message.php

phpstan.neon

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
includes:
2+
- phpstan-baseline.neon
3+
14
parameters:
25
level: 8
3-
checkMissingIterableValueType: false
4-
checkGenericClassInNonGenericObjectType: false
56
treatPhpDocTypesAsCertain: false
67
bootstrapFiles:
78
- tests/bootstrap.php
89
paths:
910
- src/
1011
ignoreErrors:
11-
- '#Parameter \#1 \$callback of static method Closure::fromCallable\(\) expects callable\(\): mixed, array\{mixed, string\} given.#'
12-
- '#Method Cake\\Queue\\Job\\Message::getTarget\(\) should return array\{class-string, string\} but returns non-empty-array.#'
12+
- identifier: missingType.iterableValue
13+
- identifier: missingType.generics
14+
- identifier: trait.unused

psalm-baseline.xml

Lines changed: 0 additions & 3 deletions
This file was deleted.

psalm.xml

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Consumption/RemoveUniqueJobIdFromCacheExtension.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function onResult(MessageResult $context): void
3939

4040
[$class, $method] = $jobMessage->getTarget();
4141

42-
/** @psalm-suppress InvalidPropertyFetch */
4342
if (empty($class::$shouldBeUnique)) {
4443
return;
4544
}

src/Job/Message.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ public function getCallable(): Closure
104104
* Get the target class and method.
105105
*
106106
* @return array{string, string}
107-
* @psalm-return array{class-string, string}
107+
* @phpstan-return array{class-string, string}
108108
*/
109109
public function getTarget(): array
110110
{
111-
/** @var array|null $target */
111+
/** @var array{class-string, string}|null $target */
112112
$target = $this->parsedBody['class'] ?? null;
113113

114114
if (!is_array($target) || count($target) !== 2) {
@@ -153,7 +153,6 @@ public function getMaxAttempts(): ?int
153153

154154
$class = $target[0];
155155

156-
/** @psalm-suppress InvalidPropertyFetch */
157156
return $class::$maxAttempts ?? null;
158157
}
159158

src/QueueManager.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ public static function push(string|array $className, array $data = [], array $op
228228

229229
$logger = $config['logger'] ? Log::engine($config['logger']) : null;
230230

231-
/** @psalm-suppress InvalidPropertyFetch */
232231
if (!empty($class::$shouldBeUnique)) {
233232
if (empty($config['uniqueCache'])) {
234233
throw new InvalidArgumentException(
@@ -277,7 +276,6 @@ public static function push(string|array $className, array $data = [], array $op
277276
$client = static::engine($name);
278277
$client->sendEvent($queue, $message);
279278

280-
/** @psalm-suppress InvalidPropertyFetch */
281279
if (!empty($class::$shouldBeUnique)) {
282280
$uniqueId = static::getUniqueId($class, $method, $data);
283281

0 commit comments

Comments
 (0)