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:
parent
6bcc763414
commit
63801c38c0
@ -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()
|
||||
)) {
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user