Skip to content

Chore: Upgrade PHPStan to 2.x#243

Merged
loks0n merged 1 commit intomainfrom
chore/phpstan-2
Apr 24, 2026
Merged

Chore: Upgrade PHPStan to 2.x#243
loks0n merged 1 commit intomainfrom
chore/phpstan-2

Conversation

@loks0n
Copy link
Copy Markdown
Contributor

@loks0n loks0n commented Apr 24, 2026

Summary

  • Bump phpstan/phpstan from 1.* to ^2.0 (installed 2.1.51)
  • Fix 3 errors surfaced at level 5 by the upgrade:
    • tests/e2e/Client.php: pass true to curl_setopt(..., CURLOPT_RETURNTRANSFER, ...) (param is bool, not int)
    • tests/RequestTest.php: drop redundant assertIsArray/assertIsInt on already-typed returns (method.alreadyNarrowedType)

Level stays at 5.

Test plan

  • composer analyze passes
  • composer test passes

🤖 Generated with Claude Code

Bumps phpstan/phpstan from 1.* to ^2.0 and fixes the 3 errors surfaced
at level 5:
- curl_setopt CURLOPT_RETURNTRANSFER value uses bool instead of int
- drop redundant assertIsArray/assertIsInt on already-typed returns

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

Upgrades PHPStan from 1.* to ^2.0 (2.1.51) and fixes the three errors it surfaces at level 5: a bool/int type mismatch on CURLOPT_RETURNTRANSFER in the e2e client and two redundant already-narrowed-type assertions in RequestTest.php. All changes are correct and minimal.

Confidence Score: 5/5

Safe to merge — straightforward dev-dependency upgrade with only test and lint fixes.

All changes are confined to dev dependencies and test files; no production logic was modified. The three fixes are correct responses to PHPStan 2.x diagnostics.

No files require special attention.

Important Files Changed

Filename Overview
composer.json Bumps phpstan/phpstan dev dependency from 1.* to ^2.0
composer.lock Lock file updated to phpstan 2.1.51; minor Composer 2.9.0 format changes (stability-flags/platform-dev empty array → object, plugin-api-version bump)
tests/RequestTest.php Removes two redundant assertions (assertIsArray / assertIsInt) that PHPStan 2.x flags as already-narrowed; no test coverage loss
tests/e2e/Client.php Fixes CURLOPT_RETURNTRANSFER argument from int 1 to bool true to satisfy PHPStan 2.x type checking

Reviews (1): Last reviewed commit: "Chore: Upgrade PHPStan to 2.x" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

k6 benchmark

Throughput Requests Fail rate p50 p95
8913 req/s 624005 0% 4.17 ms 11.12 ms

@loks0n loks0n merged commit 6019f96 into main Apr 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant