Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
testo.php export-ignore
monorepo-builder.php export-ignore
infection.json5 export-ignore
psalm.xml export-ignore
5 changes: 4 additions & 1 deletion .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
on:
push:
branches:
- '*.*'
- 2.x
pull_request: null

name: static analysis

permissions:
contents: read

jobs:
psalm:
uses: spiral/gh-actions/.github/workflows/psalm.yml@master
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
findUnusedCode="false"
>
<issueHandlers>
<!-- Making public classes final would break BC for users who extend them -->
<ClassMustBeFinal errorLevel="suppress" />
</issueHandlers>
<projectFiles>
<directory name="src" />
Expand Down
6 changes: 1 addition & 5 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use RoadRunner\Service\DTO\V1\PBList;
use RoadRunner\Service\DTO\V1\Response;
use RoadRunner\Service\DTO\V1\Service;
use RoadRunner\Service\DTO\V1\Status;
use RoadRunner\Service\DTO\V1\Statuses;
use Spiral\Goridge\RPC\Codec\ProtobufCodec;
use Spiral\Goridge\RPC\Exception\ServiceException;
Expand Down Expand Up @@ -154,7 +153,7 @@
* cpu_percent: float,
* memory_usage: positive-int,
* pid: positive-int,
* error?: array{
* error: null|array{
* code: int,
* message: non-empty-string,
* details: array{message: string, type_url: string}[]
Expand All @@ -172,11 +171,8 @@
\assert($response instanceof Statuses);

foreach ($response->getStatus() as $status) {
\assert($status instanceof Status);

$error = null;
$statusError = $status->getStatus();
/** @psalm-suppress RedundantConditionGivenDocblockType */
if ($statusError !== null) {
$error = [
'code' => $statusError->getCode(),
Expand All @@ -200,7 +196,7 @@
$this->handleError($e);
}

return $result;

Check warning on line 199 in src/Manager.php

View workflow job for this annotation

GitHub Actions / Infection

Escaped Mutant for Mutator "ArrayOneItem": @@ @@ $this->handleError($e); } - return $result; + return count($result) > 1 ? array_slice($result, 0, 1, true) : $result; } /**
}

/**
Expand Down
Loading