Skip to content

Commit d79efd3

Browse files
authored
Support psalm 4.9 (#198)
1 parent 7578578 commit d79efd3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^7.1 || ^8.0",
1414
"ext-simplexml": "*",
1515
"symfony/framework-bundle": "^3.0 || ^4.0 || ^5.0",
16-
"vimeo/psalm": "^4.8"
16+
"vimeo/psalm": "^4.9"
1717
},
1818
"require-dev": {
1919
"symfony/form": "^4.0 || ^5.0",

tests/acceptance/acceptance/ParameterBag.feature

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@symfony-common
1+
@symfony-4 @symfony-5
22
Feature: ParameterBag
33

44
Background:
@@ -69,7 +69,6 @@ Feature: ParameterBag
6969
"""
7070
When I run Psalm
7171
Then I see these errors
72-
| Type | Message |
73-
| MixedAssignment | Unable to determine the type that $nonExistentParameter is being assigned to |
74-
| Trace | $nonExistentParameter: mixed |
72+
| Type | Message |
73+
| Trace | $nonExistentParameter: array<array-key, mixed>\|null\|scalar |
7574
And I see no other errors

tests/acceptance/acceptance/console/ConsoleOption.feature

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@symfony-common
1+
@symfony-4 @symfony-5
22
Feature: ConsoleOption
33

44
Background:
@@ -284,15 +284,16 @@ Feature: ConsoleOption
284284
public function execute(InputInterface $input, OutputInterface $output): int
285285
{
286286
$optionName = 'foo';
287-
$string1 = $input->getOption($optionName);
288-
$output->writeLn(sprintf('%s', $string1));
287+
/** @psalm-trace $option */
288+
$option = $input->getOption($optionName);
289289
290290
return 0;
291291
}
292292
}
293293
"""
294294
When I run Psalm
295295
Then I see these errors
296-
| Type | Message |
297-
| PossiblyInvalidArgument | Argument 2 of sprintf expects float\|int\|string, possibly different type array<array-key, string>\|bool\|null\|string provided |
296+
| Type | Message |
297+
| MixedAssignment | Unable to determine the type that $option is being assigned to |
298+
| Trace | $option: mixed |
298299
And I see no other errors

0 commit comments

Comments
 (0)