1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Make location of constructor error more specific

This commit is contained in:
Matthew Brown 2017-01-26 23:32:03 -07:00
parent 6bcc763414
commit 63801c38c0
2 changed files with 9 additions and 1 deletions

View File

@ -546,7 +546,7 @@ abstract class ClassLikeChecker extends SourceChecker implements StatementsSourc
new PropertyNotSetInConstructor(
'Property ' . $property_id . ' is not defined in constructor of ' .
$this->fq_class_name . ' or in any private methods called in the constructor',
new CodeLocation($this, $this->class, true)
new CodeLocation($this, $constructor_checker->getFunctionLike(), true)
),
$this->source->getSuppressedIssues()
)) {

View File

@ -738,6 +738,14 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo
return $this->is_static;
}
/**
* @return Closure|Function_|ClassMethod
*/
public function getFunctionLike()
{
return $this->function;
}
/**
* @return StatementsSource
*/