Skip to content

Commit 6019f96

Browse files
loks0nclaude
andauthored
Chore: Upgrade PHPStan to 2.x (#243)
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>
1 parent 0473236 commit 6019f96

4 files changed

Lines changed: 11 additions & 13 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"require-dev": {
5353
"doctrine/instantiator": "^1.5",
5454
"laravel/pint": "1.*",
55-
"phpstan/phpstan": "1.*",
55+
"phpstan/phpstan": "^2.0",
5656
"phpunit/phpunit": "^9.5.25",
5757
"swoole/ide-helper": "4.8.3"
5858
}

composer.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/RequestTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ public function testCanGetHeaders()
2828
$this->assertEquals('value2', $this->request->getHeader('custom-new'));
2929

3030
$headers = $this->request->getHeaders();
31-
$this->assertIsArray($headers);
3231
$this->assertCount(2, $headers);
3332
$this->assertEquals('value1', $headers['custom']);
3433
$this->assertEquals('value2', $headers['custom-new']);
@@ -329,7 +328,6 @@ public function testCanGetSizeWithArrayHeaders()
329328

330329
$size = $this->request->getSize();
331330

332-
$this->assertIsInt($size);
333331
$this->assertGreaterThan(0, $size);
334332
}
335333
}

tests/e2e/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function call(string $method, string $path = '', array $headers = [], arr
6464
$cookies = [];
6565

6666
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
67-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
67+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
6868
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
6969
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36');
7070
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

0 commit comments

Comments
 (0)