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

Fix checkWithClass implementation

This commit is contained in:
Matthew Brown 2016-02-04 16:05:36 -05:00
parent c56ec0b911
commit 4f65d48c42

View File

@ -81,7 +81,11 @@ class FileChecker implements StatementsSource
$class_method = new PhpParser\Node\Stmt\ClassMethod($class_name, ['stmts' => $stmts]); $class_method = new PhpParser\Node\Stmt\ClassMethod($class_name, ['stmts' => $stmts]);
(new ClassMethodChecker($class_method, $this))->check(); $class = new PhpParser\Node\Stmt\Class_($class_name);
$class_checker = new ClassChecker($class, $this, $class_name);
(new ClassMethodChecker($class_method, $class_checker))->check();
} }
public static function getAbsoluteClassFromNameInFile($class, $namespace, $file_name) public static function getAbsoluteClassFromNameInFile($class, $namespace, $file_name)
@ -223,11 +227,13 @@ class FileChecker implements StatementsSource
return $argument_offset < count($this->_function_params[$function_name]) && $this->_function_params[$function_name][$argument_offset]; return $argument_offset < count($this->_function_params[$function_name]) && $this->_function_params[$function_name][$argument_offset];
} }
public static function checkClassPropertiesFor(callable $fn) { public static function checkClassPropertiesFor(callable $fn)
{
self::$_class_property_fn = $fn; self::$_class_property_fn = $fn;
} }
public static function checkVarDumpsFor(callable $fn) { public static function checkVarDumpsFor(callable $fn)
{
self::$_var_dump_fn = $fn; self::$_var_dump_fn = $fn;
} }
} }