File tree 2 files changed +11
-1
lines changed
src/Psalm/Internal/Analyzer/Statements/Expression
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -778,7 +778,7 @@ function (\Psalm\Internal\Clause $c) use ($mixed_var_ids) {
778
778
779
779
if ($ stmt_left_type = $ statements_analyzer ->node_data ->getType ($ stmt ->left )) {
780
780
$ if_return_type_reconciled = AssertionReconciler::reconcile (
781
- '!null ' ,
781
+ 'isset ' ,
782
782
clone $ stmt_left_type ,
783
783
'' ,
784
784
$ statements_analyzer ,
Original file line number Diff line number Diff line change @@ -1061,6 +1061,16 @@ function foo(array $_bar) : void { }
1061
1061
/** @param list<scalar|array|object|resource|null> $_s */
1062
1062
function foo(array $_s) : void { } '
1063
1063
],
1064
+ 'possiblyUndefinedObjectProperty ' => [
1065
+ '<?php
1066
+ function consume(string $value): void {
1067
+ echo $value;
1068
+ }
1069
+
1070
+ /** @var object{value?: string} $data */
1071
+ $data = json_decode("{}", false);
1072
+ consume($data->value ?? ""); '
1073
+ ],
1064
1074
];
1065
1075
}
1066
1076
You can’t perform that action at this time.
0 commit comments