mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Add support for checking var dumps
This commit is contained in:
parent
2ebca32e32
commit
9a2d5c741f
@ -14,11 +14,16 @@ class FileChecker
|
|||||||
|
|
||||||
protected static $_cache_dir = null;
|
protected static $_cache_dir = null;
|
||||||
protected static $_file_checkers = [];
|
protected static $_file_checkers = [];
|
||||||
|
protected static $_ignore_var_dump_files = [];
|
||||||
public static $show_notices = true;
|
public static $show_notices = true;
|
||||||
|
|
||||||
public function __construct($file_name)
|
public function __construct($file_name, $check_var_dumps = true)
|
||||||
{
|
{
|
||||||
$this->_file_name = $file_name;
|
$this->_file_name = $file_name;
|
||||||
|
|
||||||
|
if (!$check_var_dumps) {
|
||||||
|
self::$_ignore_var_dump_files[$this->_file_name] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function check($check_classes = true)
|
public function check($check_classes = true)
|
||||||
@ -141,4 +146,9 @@ class FileChecker
|
|||||||
{
|
{
|
||||||
self::$_cache_dir = $cache_dir;
|
self::$_cache_dir = $cache_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function shouldCheckVarDumps($file_name)
|
||||||
|
{
|
||||||
|
return isset(self::$_ignore_var_dump_files[$file_name]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user