1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-05 20:48:45 +01:00
psalm/src/Psalm/Plugin.php

111 lines
3.2 KiB
PHP
Raw Normal View History

2016-06-18 20:45:55 +02:00
<?php
2016-07-26 00:37:44 +02:00
namespace Psalm;
2016-06-18 20:45:55 +02:00
use PhpParser;
use Psalm\Checker\StatementsChecker;
use Psalm\FileManipulation\FileManipulation;
2018-01-21 18:44:46 +01:00
use Psalm\Scanner\FileScanner;
use Psalm\Storage\ClassLikeStorage;
use Psalm\Type\Union;
2016-06-18 20:45:55 +02:00
abstract class Plugin
{
/**
* Called after an expression has been checked
2016-11-02 07:29:00 +01:00
*
* @param StatementsChecker $statements_checker
2016-06-18 20:45:55 +02:00
* @param PhpParser\Node\Expr $stmt
2016-06-20 07:29:30 +02:00
* @param Context $context
* @param CodeLocation $code_location
* @param string[] $suppressed_issues
* @param FileManipulation[] $file_replacements
2017-05-27 02:16:18 +02:00
*
2016-06-18 20:45:55 +02:00
* @return null|false
*/
public static function afterExpressionCheck(
StatementsChecker $statements_checker,
PhpParser\Node\Expr $stmt,
Context $context,
CodeLocation $code_location,
array $suppressed_issues,
array &$file_replacements = []
) {
2016-11-02 07:29:00 +01:00
return null;
2016-06-18 20:45:55 +02:00
}
/**
* Called after a statement has been checked
2016-11-02 07:29:00 +01:00
*
* @param StatementsChecker $statements_checker
2016-12-12 19:50:46 +01:00
* @param PhpParser\Node\Stmt|PhpParser\Node\Expr $stmt
* @param Context $context
* @param CodeLocation $code_location
* @param string[] $suppressed_issues
* @param FileManipulation[] $file_replacements
2017-05-27 02:16:18 +02:00
*
2016-06-18 20:45:55 +02:00
* @return null|false
*/
public static function afterStatementCheck(
StatementsChecker $statements_checker,
PhpParser\Node $stmt,
Context $context,
CodeLocation $code_location,
array $suppressed_issues,
array &$file_replacements = []
) {
2016-11-02 07:29:00 +01:00
return null;
2016-06-18 20:45:55 +02:00
}
/**
* @param FileManipulation[] $file_replacements
2017-05-27 02:16:18 +02:00
*
* @return void
*/
public static function afterVisitClassLike(
2017-05-05 06:06:46 +02:00
PhpParser\Node\Stmt\ClassLike $stmt,
ClassLikeStorage $storage,
FileScanner $file,
Aliases $aliases,
array &$file_replacements = []
) {
}
/**
* @param string $fq_class_name
* @param FileManipulation[] $file_replacements
*
* @return void
*/
public static function afterClassLikeExistsCheck(
StatementsSource $statements_source,
$fq_class_name,
CodeLocation $code_location,
array &$file_replacements = []
) {
}
/**
* @param string $method_id - the method id being checked
* @param string $appearing_method_id - the method id of the class that the method appears in
* @param string $declaring_method_id - the method id of the class or trait that declares the method
* @param string|null $var_id - a reference to the LHS of the variable
* @param PhpParser\Node\Arg[] $args
* @param FileManipulation[] $file_replacements
*
* @return void
*/
public static function afterMethodCallCheck(
StatementsSource $statements_source,
$method_id,
$appearing_method_id,
$declaring_method_id,
$var_id,
array $args,
CodeLocation $code_location,
Context $context,
array &$file_replacements = [],
Union &$return_type_candidate = null
) {
}
2016-06-18 20:45:55 +02:00
}