From 4124294d2c441a95f840d2529a9088280a2b957e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 20:51:22 +0300 Subject: [PATCH 1/2] Update rector/rector requirement from ^0.19.0 to ^1.0.0 (#52) Updates the requirements on [rector/rector](https://github.com/rectorphp/rector) to permit the latest version. - [Release notes](https://github.com/rectorphp/rector/releases) - [Commits](https://github.com/rectorphp/rector/compare/0.19.0...1.0.0) --- updated-dependencies: - dependency-name: rector/rector dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8e0f098..9d637bf 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "maglnet/composer-require-checker": "^3.8|^4.2", "nyholm/psr7": "^1.3", "phpunit/phpunit": "^9.5", - "rector/rector": "^0.19.0", + "rector/rector": "^1.0.0", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", "vimeo/psalm": "^4.30|^5.6", From 96f602a24039021ef2066dacfe5f2f73222f2f3b Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Wed, 7 Feb 2024 20:56:42 +0300 Subject: [PATCH 2/2] Fix psalm (#54) --- .github/workflows/static.yml | 11 ++++++++++- composer.json | 2 +- psalm.xml | 4 ++++ psalm74-80.xml | 19 +++++++++++++++++++ src/CsrfMiddleware.php | 1 - .../Storage/SessionCsrfTokenStorage.php | 1 - 6 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 psalm74-80.xml diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 40ac260..d904be7 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -10,6 +10,7 @@ on: - 'phpunit.xml.dist' push: + branches: [ 'master' ] paths-ignore: - 'docs/**' - 'README.md' @@ -28,4 +29,12 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['7.4', '8.0', '8.1'] + ['8.1', '8.2', '8.3'] + psalm74-80: + uses: yiisoft/actions/.github/workflows/psalm.yml@master + with: + psalm-config: psalm74-80.xml + os: >- + ['ubuntu-latest'] + php: >- + ['7.4', '8.0'] diff --git a/composer.json b/composer.json index 9d637bf..dac960d 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "rector/rector": "^1.0.0", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^4.30|^5.6", + "vimeo/psalm": "^4.30|^5.21", "yiisoft/di": "^1.1" }, "autoload": { diff --git a/psalm.xml b/psalm.xml index 277e73d..b48c894 100644 --- a/psalm.xml +++ b/psalm.xml @@ -13,4 +13,8 @@ + + + + diff --git a/psalm74-80.xml b/psalm74-80.xml new file mode 100644 index 0000000..d091d59 --- /dev/null +++ b/psalm74-80.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/src/CsrfMiddleware.php b/src/CsrfMiddleware.php index 467712c..cffab6c 100644 --- a/src/CsrfMiddleware.php +++ b/src/CsrfMiddleware.php @@ -98,7 +98,6 @@ private function getTokenFromRequest(ServerRequestInterface $request): ?string { $parsedBody = $request->getParsedBody(); - /** @var mixed $token */ $token = $parsedBody[$this->parameterName] ?? null; if (empty($token)) { $headers = $request->getHeader($this->headerName); diff --git a/src/Synchronizer/Storage/SessionCsrfTokenStorage.php b/src/Synchronizer/Storage/SessionCsrfTokenStorage.php index db47458..d9ff131 100644 --- a/src/Synchronizer/Storage/SessionCsrfTokenStorage.php +++ b/src/Synchronizer/Storage/SessionCsrfTokenStorage.php @@ -33,7 +33,6 @@ public function __construct(SessionInterface $session, string $key = self::KEY) public function get(): ?string { - /** @var mixed $value */ $value = $this->session->get($this->key); return is_string($value) ? $value : null; }