2016-06-18 14:45:55 -04:00
|
|
|
<?php
|
2016-07-25 18:37:44 -04:00
|
|
|
namespace Psalm;
|
2016-06-18 14:45:55 -04:00
|
|
|
|
|
|
|
use PhpParser;
|
2017-11-07 14:46:53 -05:00
|
|
|
use Psalm\Checker\FileChecker;
|
2017-01-02 15:31:18 -05:00
|
|
|
use Psalm\Checker\StatementsChecker;
|
2017-11-07 14:46:53 -05:00
|
|
|
use Psalm\FileManipulation\FileManipulation;
|
2017-05-04 22:40:24 -04:00
|
|
|
use Psalm\Storage\ClassLikeStorage;
|
2016-06-18 14:45:55 -04:00
|
|
|
|
|
|
|
abstract class Plugin
|
|
|
|
{
|
|
|
|
/**
|
2017-11-07 14:46:53 -05:00
|
|
|
* Called after an expression has been checked
|
2016-11-02 02:29:00 -04:00
|
|
|
*
|
2017-01-02 15:31:18 -05:00
|
|
|
* @param StatementsChecker $statements_checker
|
2016-06-18 14:45:55 -04:00
|
|
|
* @param PhpParser\Node\Expr $stmt
|
2016-06-20 01:29:30 -04:00
|
|
|
* @param Context $context
|
2016-12-03 19:11:30 -05:00
|
|
|
* @param CodeLocation $code_location
|
2017-11-07 14:46:53 -05:00
|
|
|
* @param string[] $suppressed_issues
|
|
|
|
* @param FileManipulation[] $file_replacements
|
2017-05-26 20:16:18 -04:00
|
|
|
*
|
2016-06-18 14:45:55 -04:00
|
|
|
* @return null|false
|
|
|
|
*/
|
2017-11-07 14:46:53 -05:00
|
|
|
public function afterExpressionCheck(
|
2017-01-02 15:31:18 -05:00
|
|
|
StatementsChecker $statements_checker,
|
|
|
|
PhpParser\Node\Expr $stmt,
|
|
|
|
Context $context,
|
|
|
|
CodeLocation $code_location,
|
2017-11-07 14:46:53 -05:00
|
|
|
array $suppressed_issues,
|
|
|
|
array &$file_replacements = []
|
2017-01-02 15:31:18 -05:00
|
|
|
) {
|
2016-11-02 02:29:00 -04:00
|
|
|
return null;
|
2016-06-18 14:45:55 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-11-07 14:46:53 -05:00
|
|
|
* Called after a statement has been checked
|
2016-11-02 02:29:00 -04:00
|
|
|
*
|
2017-01-02 15:31:18 -05:00
|
|
|
* @param StatementsChecker $statements_checker
|
2016-12-12 13:50:46 -05:00
|
|
|
* @param PhpParser\Node\Stmt|PhpParser\Node\Expr $stmt
|
|
|
|
* @param Context $context
|
|
|
|
* @param CodeLocation $code_location
|
2017-11-07 14:46:53 -05:00
|
|
|
* @param string[] $suppressed_issues
|
|
|
|
* @param FileManipulation[] $file_replacements
|
2017-05-26 20:16:18 -04:00
|
|
|
*
|
2016-06-18 14:45:55 -04:00
|
|
|
* @return null|false
|
|
|
|
*/
|
2017-11-07 14:46:53 -05:00
|
|
|
public function afterStatementCheck(
|
2017-01-02 15:31:18 -05:00
|
|
|
StatementsChecker $statements_checker,
|
|
|
|
PhpParser\Node $stmt,
|
|
|
|
Context $context,
|
|
|
|
CodeLocation $code_location,
|
2017-11-07 14:46:53 -05:00
|
|
|
array $suppressed_issues,
|
|
|
|
array &$file_replacements = []
|
2017-01-02 15:31:18 -05:00
|
|
|
) {
|
2016-11-02 02:29:00 -04:00
|
|
|
return null;
|
2016-06-18 14:45:55 -04:00
|
|
|
}
|
2017-05-04 22:40:24 -04:00
|
|
|
|
|
|
|
/**
|
2017-11-07 14:46:53 -05:00
|
|
|
* @param FileManipulation[] $file_replacements
|
2017-05-26 20:16:18 -04:00
|
|
|
*
|
2017-11-07 14:46:53 -05:00
|
|
|
* @return void
|
2017-05-04 22:40:24 -04:00
|
|
|
*/
|
|
|
|
public function visitClassLike(
|
2017-05-05 00:06:46 -04:00
|
|
|
PhpParser\Node\Stmt\ClassLike $stmt,
|
2017-05-04 22:40:24 -04:00
|
|
|
ClassLikeStorage $storage,
|
2017-11-07 14:46:53 -05:00
|
|
|
FileChecker $file_checker,
|
|
|
|
Aliases $aliases,
|
|
|
|
array &$file_replacements = []
|
2017-05-04 22:40:24 -04:00
|
|
|
) {
|
|
|
|
}
|
2018-01-01 21:17:23 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param string $fq_class_name
|
|
|
|
* @param FileManipulation[] $file_replacements
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function afterClassLikeExistsCheck(
|
|
|
|
StatementsSource $statements_source,
|
|
|
|
$fq_class_name,
|
|
|
|
CodeLocation $code_location,
|
|
|
|
array &$file_replacements = []
|
|
|
|
) {
|
|
|
|
}
|
2016-06-18 14:45:55 -04:00
|
|
|
}
|