Skip to content
Permalink
Browse files

Fix #2545 - fix bug when coming back after analysing method call in c…

…onstructor
  • Loading branch information
muglug committed Jan 3, 2020
1 parent 0e39759 commit 996053cca64dc0e5b5e0112325e82ccc67b69388
@@ -210,6 +210,8 @@ public static function collectSpecialInformation(
}
}

$old_calling_function_id = $context->calling_function_id;

if ($fq_class_name === $source->getFQCLN()) {
$class_analyzer->getMethodMutations(strtolower($method_name), $context);
} else {
@@ -226,6 +228,8 @@ public static function collectSpecialInformation(
$context->self = $old_self;
}

$context->calling_function_id = $old_calling_function_id;

foreach ($local_vars_in_scope as $var => $type) {
$context->vars_in_scope[$var] = $type;
}
@@ -278,6 +278,25 @@ public function getError(): ?string {
takesString($dto->getError());
}'
],
'allowConstructorPrivateUnusedMethods' => [
'<?php
/**
* @psalm-immutable
*/
class PaymentShared
{
/** @var int */
private $commission;
public function __construct()
{
$this->test();
$this->commission = 1;
}
private function test(): void {}
}'
],
];
}

0 comments on commit 996053c

Please sign in to comment.
You can’t perform that action at this time.