mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Don’t unset $this when calculating scope changes
This commit is contained in:
parent
4c3dacbbed
commit
a35f2e0792
@ -361,13 +361,13 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
|
||||
}
|
||||
|
||||
foreach ($context->vars_in_scope as $var => $type) {
|
||||
if (strpos($var, '$this->') !== 0) {
|
||||
if (strpos($var, '$this->') !== 0 && $var !== '$this') {
|
||||
unset($context->vars_in_scope[$var]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($context->vars_possibly_in_scope as $var => $type) {
|
||||
if (strpos($var, '$this->') !== 0) {
|
||||
if (strpos($var, '$this->') !== 0 && $var !== '$this') {
|
||||
unset($context->vars_possibly_in_scope[$var]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user