mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
parent
157c575a96
commit
2212d7c032
@ -1360,6 +1360,10 @@ class CallChecker
|
||||
|
||||
$context->include_location = $old_context_include_location;
|
||||
$context->self = $old_self;
|
||||
|
||||
if (isset($context->vars_in_scope['$this']) && $old_self) {
|
||||
$context->vars_in_scope['$this'] = Type::parseString($old_self);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$namespace = $statements_checker->getNamespace()
|
||||
|
@ -689,6 +689,36 @@ class PropertyTypeTest extends TestCase
|
||||
}
|
||||
}',
|
||||
],
|
||||
'privatePropertyAccessibleInTwoSubclasses' => [
|
||||
'<?php
|
||||
class A {
|
||||
public function __construct() {}
|
||||
}
|
||||
class B extends A {
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $prop;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->prop = 1;
|
||||
}
|
||||
}
|
||||
class C extends A {
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $prop;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->prop = 2;
|
||||
}
|
||||
}',
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user