Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit 4854503

Browse files
committed
Psalm level 2
1 parent ad9e4ff commit 4854503

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
},
1515
"require-dev": {
1616
"phpunit/phpunit": "^9.0",
17-
"php-coveralls/php-coveralls": "^2.0"
17+
"php-coveralls/php-coveralls": "^2.0",
18+
"vimeo/psalm": "^4.1"
1819
},
1920
"autoload": {
2021
"psr-4": {

psalm.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="2"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
</psalm>

src/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ private function parseQualityValues(string $header) : array
12001200
$position--;
12011201
}
12021202

1203-
usort($result, static function(array $a, array $b) {
1203+
usort($result, static function(array $a, array $b): int {
12041204
return $b[2] - $a[2];
12051205
});
12061206

src/UploadedFileMap.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ private static function normalizeSuperglobal(array $files) : array
3939
foreach ($files as $file) {
4040
$keys = array_keys($file);
4141

42-
if (is_array($keys)) {
43-
foreach ($keys as $key) {
44-
$result[$key] = [];
45-
foreach ($files as $index => $file) {
46-
$result[$key][$index] = $file[$key];
47-
}
42+
foreach ($keys as $key) {
43+
$result[$key] = [];
44+
foreach ($files as $index => $file) {
45+
$result[$key][$index] = $file[$key];
4846
}
4947
}
5048

0 commit comments

Comments
 (0)