1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix out-of-date explanation.

This commit is contained in:
Matthew Brown 2020-11-30 00:05:53 -05:00 committed by Daniil Gentili
parent 4ca1fd7d26
commit 68218008e1
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -64,7 +64,7 @@ Somewhere in `FunctionLikeAnalyzer::analyze` we create a new [`StatementsAnalyze
At each line the `Context` object may or may not be manipulated. At branching points (if statements, loops, ternary etc) the `Context` object is cloned and then, at the end of the branch, Psalm figures out how to resolve the changes and update the uncloned `Context` object. At each line the `Context` object may or may not be manipulated. At branching points (if statements, loops, ternary etc) the `Context` object is cloned and then, at the end of the branch, Psalm figures out how to resolve the changes and update the uncloned `Context` object.
Each PhpParser node is then abused, adding a property called `inferredType` which Psalm uses for type analysis. The `NodeDataProvider` stores a type for each PhpParser node.
After all the statements have been analysed we gather up all the return types and compare to the given return type. After all the statements have been analysed we gather up all the return types and compare to the given return type.