mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
Don’t convert trait self to trait name
This commit is contained in:
parent
c66a106622
commit
372a512a86
@ -2157,7 +2157,7 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse
|
||||
$docblock_info->params,
|
||||
$stmt,
|
||||
$fake_method,
|
||||
$class_storage ? $class_storage->name : null
|
||||
$class_storage && !$class_storage->is_trait ? $class_storage->name : null
|
||||
);
|
||||
}
|
||||
|
||||
@ -2279,7 +2279,7 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse
|
||||
$this->aliases,
|
||||
$this->function_template_types + $this->class_template_types,
|
||||
$this->type_aliases,
|
||||
$class_storage ? $class_storage->name : null
|
||||
$class_storage && !$class_storage->is_trait ? $class_storage->name : null
|
||||
);
|
||||
|
||||
$storage->return_type = Type::parseTokens(
|
||||
|
@ -854,6 +854,19 @@ class TraitTest extends TestCase
|
||||
$f1 = new Foo();
|
||||
$f2 = (new Foo())->bar($f1);',
|
||||
],
|
||||
'traitSelfDocblockReturn' => [
|
||||
'<?php
|
||||
trait T {
|
||||
/** @return self */
|
||||
public function getSelf() {
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
use T;
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user