Skip to content

Commit ab5d6ee

Browse files
authored
Merge pull request #166 from cakephp/2.x-update-stan
update stan
2 parents ecf7435 + 9bd695f commit ab5d6ee

20 files changed

+44
-76
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/Command/RequeueCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function execute(Arguments $args, ConsoleIo $io): void
138138
'config' => $failedJob->config,
139139
'priority' => $failedJob->priority,
140140
'queue' => $failedJob->queue,
141-
]
141+
],
142142
);
143143

144144
$failedJobsTable->deleteOrFail($failedJob);

src/Command/WorkerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getOptionParser(): ConsoleOptionParser
110110
'short' => 'a',
111111
]);
112112
$parser->setDescription(
113-
'Runs a queue worker that consumes from the named queue.'
113+
'Runs a queue worker that consumes from the named queue.',
114114
);
115115

116116
return $parser;

src/Consumption/LimitAttemptsExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public function onResult(MessageResult $context): void
6565

6666
if ($attemptNumber >= $maxAttempts) {
6767
$context->changeResult(
68-
Result::reject(sprintf('The maximum number of %d allowed attempts was reached.', $maxAttempts))
68+
Result::reject(sprintf('The maximum number of %d allowed attempts was reached.', $maxAttempts)),
6969
);
7070

7171
$exception = (string)$message->getProperty('jobException');
7272

7373
$this->dispatchEvent(
7474
'Consumption.LimitAttemptsExtension.failed',
7575
['exception' => $exception, 'logger' => $context->getLogger()],
76-
$jobMessage
76+
$jobMessage,
7777
);
7878

7979
return;
@@ -88,7 +88,7 @@ public function onResult(MessageResult $context): void
8888
$producer->send($consumer->getQueue(), $newMessage);
8989

9090
$context->changeResult(
91-
Result::reject('A copy of the message was sent with an incremented attempt count.')
91+
Result::reject('A copy of the message was sent with an incremented attempt count.'),
9292
);
9393
}
9494
}

src/Consumption/LimitConsumedMessagesExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function shouldBeStopped(LoggerInterface $logger): bool
7979
$logger->debug(sprintf(
8080
'[LimitConsumedMessagesExtension] Message consumption is interrupted since the message limit ' .
8181
'reached. limit: "%s"',
82-
$this->messageLimit
82+
$this->messageLimit,
8383
));
8484

8585
return true;

0 commit comments

Comments
 (0)