Skip to content

Commit

Permalink
Upgrade SA tools (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Aug 28, 2022
1 parent 0e5bbfc commit 97931c5
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 84 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Mimic PHP 8.1
run: composer config platform.php 8.1.999
if: matrix.php > 8.1

- name: Download dependencies
run: composer update --no-interaction --optimize-autoloader --prefer-stable

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
composer update --no-interaction --optimize-autoloader
- name: PHPStan
uses: docker://oskarstark/phpstan-ga:0.12.25
uses: docker://oskarstark/phpstan-ga:1.6.0
with:
entrypoint: /composer/vendor/bin/phpstan
args: analyze --no-progress
Expand All @@ -39,7 +39,7 @@ jobs:
run: composer update --no-interaction --no-progress

- name: Download PHP CS Fixer
run: composer require "friendsofphp/php-cs-fixer:3.2.1"
run: composer require "friendsofphp/php-cs-fixer:3.10.0"

- name: Execute PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --diff --dry-run
Expand Down
34 changes: 32 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$function of function register_shutdown_function expects callable\\(\\)\\: void, Closure\\(\\)\\: mixed given\\.$#"
message: "#^Cannot call method reject\\(\\) on null\\.$#"
count: 1
path: src/TaskQueue.php
path: src/EachPromise.php

-
message: "#^Dead catch \\- Exception is already caught above\\.$#"
count: 2
path: src/EachPromise.php

-
message: "#^Dead catch \\- Exception is already caught above\\.$#"
count: 1
path: src/FulfilledPromise.php

-
message: "#^Dead catch \\- Exception is already caught above\\.$#"
count: 2
path: src/Promise.php

-
message: "#^Dead catch \\- Exception is already caught above\\.$#"
count: 1
path: src/RejectedPromise.php

-
message: "#^Dead catch \\- Exception is already caught above\\.$#"
count: 2
path: src/Utils.php

-
message: "#^Dead catch \\- GuzzleHttp\\\\Promise\\\\RejectionException is never thrown in the try block\\.$#"
count: 1
path: src/Utils.php

3 changes: 0 additions & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ parameters:
level: 5
paths:
- src

ignoreErrors:
- "#^Dead catch - Exception is already caught by Throwable above\\.$#"
8 changes: 0 additions & 8 deletions src/EachPromise.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,8 @@ public function promise()
$this->iterable->rewind();
$this->refillPending();
} catch (\Throwable $e) {
/**
* @psalm-suppress NullReference
* @phpstan-ignore-next-line
*/
$this->aggregate->reject($e);
} catch (\Exception $e) {
/**
* @psalm-suppress NullReference
* @phpstan-ignore-next-line
*/
$this->aggregate->reject($e);
}

Expand Down
Loading

0 comments on commit 97931c5

Please sign in to comment.