Skip to content

Commit 0a732ef

Browse files
authored
Merge pull request #41 from sunrise-php/release/v3.4.0
v3.4
2 parents 4ccf8a5 + 29eaeb2 commit 0a732ef

6 files changed

Lines changed: 20 additions & 14 deletions

File tree

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
"psr/http-message": "^1.0"
3737
},
3838
"require-dev": {
39-
"php-di/php-di": "^6.4",
39+
"php-di/php-di": "^6.4 || ^7.0",
4040
"php-http/psr7-integration-tests": "^1.4",
41-
"phpstan/phpstan": "^1.12",
41+
"phpstan/phpstan": "^2.1",
4242
"phpunit/phpunit": "^9.6",
4343
"sunrise/coding-standard": "^1.0",
44-
"vimeo/psalm": "^5.26"
44+
"vimeo/psalm": "^5.26 || ^6.0"
4545
},
4646
"autoload": {
4747
"files": [
@@ -61,15 +61,15 @@
6161
}
6262
},
6363
"scripts": {
64+
"phpcs": "@php phpcs --colors",
65+
"psalm": "@php psalm --no-cache",
66+
"phpstan": "@php phpstan analyse src --level=9 --memory-limit=-1",
67+
"phpunit": "@php phpunit --colors=always",
6468
"test": [
65-
"phpcs --colors",
66-
"psalm --no-cache",
67-
"phpstan analyse src --level=9 --memory-limit=-1",
68-
"XDEBUG_MODE=coverage phpunit --coverage-text --colors=always"
69-
],
70-
"build": [
71-
"phpdoc -d src/ -t phpdoc/",
72-
"XDEBUG_MODE=coverage phpunit --coverage-html coverage/"
69+
"@phpcs",
70+
"@psalm",
71+
"@phpstan",
72+
"@phpunit"
7373
]
7474
},
7575
"conflict": {

psalm.xml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@
1212
<directory name="vendor" />
1313
</ignoreFiles>
1414
</projectFiles>
15+
16+
<issueHandlers>
17+
<PossiblyUnusedMethod errorLevel="suppress" />
18+
<PossiblyUnusedReturnValue errorLevel="suppress" />
19+
<UnusedClass errorLevel="suppress" />
20+
</issueHandlers>
1521
</psalm>

src/Request/JsonRequest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ private static function createBody($data, int $flags, int $depth): StreamInterfa
5757
}
5858

5959
try {
60+
/** @var non-empty-string $json */
6061
$json = json_encode($data, $flags | JSON_THROW_ON_ERROR, $depth);
6162
} catch (JsonException $e) {
6263
throw new InvalidArgumentException(sprintf(

src/Response/JsonResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ private static function createBody($data, int $flags, int $depth): StreamInterfa
5353
}
5454

5555
try {
56+
/** @var non-empty-string $json */
5657
$json = json_encode($data, $flags | JSON_THROW_ON_ERROR, $depth);
5758
} catch (JsonException $e) {
5859
throw new InvalidArgumentException(sprintf(

src/Stream.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public function isSeekable(): bool
137137
return false;
138138
}
139139

140-
/** @var array{seekable: bool} */
141140
$metadata = stream_get_meta_data($this->resource);
142141

143142
return $metadata['seekable'];
@@ -179,7 +178,6 @@ public function isWritable(): bool
179178
return false;
180179
}
181180

182-
/** @var array{mode: string} */
183181
$metadata = stream_get_meta_data($this->resource);
184182

185183
return strpbrk($metadata['mode'], '+acwx') !== false;
@@ -215,7 +213,6 @@ public function isReadable(): bool
215213
return false;
216214
}
217215

218-
/** @var array{mode: string} */
219216
$metadata = stream_get_meta_data($this->resource);
220217

221218
return strpbrk($metadata['mode'], '+r') !== false;

src/UploadedFile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public function getStream(): StreamInterface
105105
public function moveTo($targetPath): void
106106
{
107107
/** @psalm-suppress TypeDoesNotContainType */
108+
// @phpstan-ignore function.alreadyNarrowedType
108109
if (!is_string($targetPath)) {
109110
throw new TypeError(sprintf(
110111
'Argument #1 ($targetPath) must be of type string, %s given',

0 commit comments

Comments
 (0)