mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Fix #2923 - remove hack to fix a template issue
This commit is contained in:
parent
51bfc7c619
commit
a2a507166d
@ -639,10 +639,6 @@ class StaticCallAnalyzer extends \Psalm\Internal\Analyzer\Statements\Expression\
|
||||
|
||||
$context->include_location = $old_context_include_location;
|
||||
$context->self = $old_self;
|
||||
|
||||
if (isset($context->vars_in_scope['$this'])) {
|
||||
$context->vars_in_scope['$this'] = Type::parseString($old_self);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1866,6 +1866,50 @@ class PropertyTypeTest extends TestCase
|
||||
}
|
||||
}',
|
||||
],
|
||||
'someConditionalCallToParentConstructor' => [
|
||||
'<?php
|
||||
class GrandParentClassDoesNotDefine {
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
class ParentClassDefinesVar extends GrandParentClassDoesNotDefine {
|
||||
protected string $val;
|
||||
|
||||
public function __construct() {
|
||||
$this->val = "hello";
|
||||
if (true) {
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ChildClass extends ParentClassDefinesVar {
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
}'
|
||||
],
|
||||
'noConditionalCallToParentConstructor' => [
|
||||
'<?php
|
||||
class GrandParentClassDoesNotDefine {
|
||||
public function __construct() {}
|
||||
}
|
||||
|
||||
class ParentClassDefinesVar extends GrandParentClassDoesNotDefine {
|
||||
protected string $val;
|
||||
|
||||
public function __construct() {
|
||||
$this->val = "hello";
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
||||
|
||||
class ChildClass extends ParentClassDefinesVar {
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
}
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user