diff --git a/src/Psalm/Checker/CommentChecker.php b/src/Psalm/Checker/CommentChecker.php index 2c0715372..55999f519 100644 --- a/src/Psalm/Checker/CommentChecker.php +++ b/src/Psalm/Checker/CommentChecker.php @@ -17,7 +17,6 @@ class CommentChecker /** * @param string $comment - * @param Context|null $context * @param StatementsSource $source * @param Aliases $aliases * @param array|null $template_types @@ -31,7 +30,6 @@ class CommentChecker */ public static function getTypeFromComment( $comment, - $context, StatementsSource $source, Aliases $aliases, array $template_types = null, diff --git a/src/Psalm/Checker/FileChecker.php b/src/Psalm/Checker/FileChecker.php index 2cbb209da..277c7cb3f 100644 --- a/src/Psalm/Checker/FileChecker.php +++ b/src/Psalm/Checker/FileChecker.php @@ -101,13 +101,11 @@ class FileChecker extends SourceChecker implements StatementsSource * @param string $file_path * @param ProjectChecker $project_checker * @param bool $will_analyze - * @param array $included_file_paths */ public function __construct( $file_path, ProjectChecker $project_checker, - $will_analyze = true, - array $included_file_paths = [] + $will_analyze = true ) { $this->file_path = $file_path; $this->file_name = Config::getInstance()->shortenFileName($this->file_path); diff --git a/src/Psalm/Checker/FunctionLikeChecker.php b/src/Psalm/Checker/FunctionLikeChecker.php index 9d835db9c..7a41f8e4c 100644 --- a/src/Psalm/Checker/FunctionLikeChecker.php +++ b/src/Psalm/Checker/FunctionLikeChecker.php @@ -336,7 +336,7 @@ abstract class FunctionLikeChecker extends SourceChecker implements StatementsSo } else { // Closure $file_storage = $file_storage_provider->get($this->source->getFilePath()); - $function_id = $cased_function_id = $this->getMethodId(); + $function_id = $this->getMethodId(); if (!isset($file_storage->functions[$function_id])) { throw new \UnexpectedValueException('Closure function ' . $function_id . ' should exist'); diff --git a/src/Psalm/Checker/ProjectChecker.php b/src/Psalm/Checker/ProjectChecker.php index 43ff9ba5c..c55843cd3 100644 --- a/src/Psalm/Checker/ProjectChecker.php +++ b/src/Psalm/Checker/ProjectChecker.php @@ -721,14 +721,12 @@ class ProjectChecker /** * @param string $fq_class_name - * @param string $parent_class * * @return void */ protected function inheritMethodsFromParent(ClassLikeStorage $storage, ClassLikeStorage $parent_storage) { $fq_class_name = $storage->name; - $parent_class = $parent_storage->name; // register where they appear (can never be in a trait) foreach ($parent_storage->appearing_method_ids as $method_name => $appearing_method_id) { diff --git a/src/Psalm/Checker/Statements/Block/ForeachChecker.php b/src/Psalm/Checker/Statements/Block/ForeachChecker.php index 1195624e0..a6e0090b1 100644 --- a/src/Psalm/Checker/Statements/Block/ForeachChecker.php +++ b/src/Psalm/Checker/Statements/Block/ForeachChecker.php @@ -229,7 +229,6 @@ class ForeachChecker if ($doc_comment_text) { $var_comment = CommentChecker::getTypeFromComment( $doc_comment_text, - $foreach_context, $statements_checker->getSource(), $statements_checker->getSource()->getAliases() ); diff --git a/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php b/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php index 21e33028b..9926a5cc6 100644 --- a/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php +++ b/src/Psalm/Checker/Statements/Expression/AssignmentChecker.php @@ -47,7 +47,6 @@ class AssignmentChecker * @param Type\Union|null $assign_value_type * @param Context $context * @param string $doc_comment - * @param bool $by_reference * @param int|null $came_from_line_number * * @return false|Type\Union @@ -59,7 +58,6 @@ class AssignmentChecker $assign_value_type, Context $context, $doc_comment, - $by_reference = false, $came_from_line_number = null ) { $var_id = ExpressionChecker::getVarId( @@ -81,7 +79,6 @@ class AssignmentChecker if ($doc_comment) { $var_comment = CommentChecker::getTypeFromComment( $doc_comment, - $context, $statements_checker->getSource(), $statements_checker->getAliases(), null, @@ -440,8 +437,7 @@ class AssignmentChecker $stmt->expr, null, $context, - (string)$stmt->getDocComment(), - true + (string)$stmt->getDocComment() ) === false) { return false; } diff --git a/src/Psalm/Checker/Statements/Expression/CallChecker.php b/src/Psalm/Checker/Statements/Expression/CallChecker.php index 2a7d2890d..2fc679fbe 100644 --- a/src/Psalm/Checker/Statements/Expression/CallChecker.php +++ b/src/Psalm/Checker/Statements/Expression/CallChecker.php @@ -240,7 +240,6 @@ class CallChecker if (!$in_call_map && !$is_stubbed) { if ($context->check_functions) { if (self::checkFunctionExists( - $project_checker, $statements_checker, $method_id, $code_location @@ -2441,7 +2440,6 @@ class CallChecker } } else { if (self::checkFunctionExists( - $project_checker, $statements_checker, $function_id, $code_location @@ -2522,7 +2520,6 @@ class CallChecker * @return bool */ protected static function checkFunctionExists( - ProjectChecker $project_checker, StatementsChecker $statements_checker, &$function_id, CodeLocation $code_location diff --git a/src/Psalm/Checker/Statements/ExpressionChecker.php b/src/Psalm/Checker/Statements/ExpressionChecker.php index 87c56bfce..66541b723 100644 --- a/src/Psalm/Checker/Statements/ExpressionChecker.php +++ b/src/Psalm/Checker/Statements/ExpressionChecker.php @@ -84,7 +84,6 @@ class ExpressionChecker null, $context, (string)$stmt->getDocComment(), - false, $stmt->getLine() ); @@ -1891,7 +1890,6 @@ class ExpressionChecker if ($doc_comment_text) { $var_comment = CommentChecker::getTypeFromComment( $doc_comment_text, - $context, $statements_checker, $statements_checker->getAliases() ); diff --git a/src/Psalm/Checker/StatementsChecker.php b/src/Psalm/Checker/StatementsChecker.php index fbbe3df7b..424931362 100644 --- a/src/Psalm/Checker/StatementsChecker.php +++ b/src/Psalm/Checker/StatementsChecker.php @@ -330,7 +330,6 @@ class StatementsChecker extends SourceChecker implements StatementsSource if ((string)$stmt->getDocComment()) { $var_comment = CommentChecker::getTypeFromComment( (string)$stmt->getDocComment(), - $context, $this->getSource(), $this->getSource()->getAliases() ); @@ -893,7 +892,6 @@ class StatementsChecker extends SourceChecker implements StatementsSource if ($doc_comment_text) { $var_comment = CommentChecker::getTypeFromComment( $doc_comment_text, - $context, $this->source, $this->source->getAliases() ); diff --git a/src/Psalm/Visitor/DependencyFinderVisitor.php b/src/Psalm/Visitor/DependencyFinderVisitor.php index 66e2dd249..70c8a8cf6 100644 --- a/src/Psalm/Visitor/DependencyFinderVisitor.php +++ b/src/Psalm/Visitor/DependencyFinderVisitor.php @@ -377,7 +377,6 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P if ($doc_comment = $node->getDocComment()) { $var_comment = CommentChecker::getTypeFromComment( (string)$doc_comment, - null, $this->file_checker, $this->aliases, null, @@ -1073,7 +1072,6 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P $property_type_line_number = $comment->getLine(); $var_comment = CommentChecker::getTypeFromComment( $comment->getText(), - null, $this->file_checker, $this->aliases, $this->function_template_types + $this->class_template_types, diff --git a/tests/MethodMutationTest.php b/tests/MethodMutationTest.php index f764b72e7..9d5b635a5 100644 --- a/tests/MethodMutationTest.php +++ b/tests/MethodMutationTest.php @@ -89,7 +89,7 @@ class MethodMutationTest extends TestCase }' ); - $file_checker = new FileChecker('somefile.php', $this->project_checker); + new FileChecker('somefile.php', $this->project_checker); $this->project_checker->scanFiles(); $method_context = new Context(); $this->project_checker->getMethodMutations('FooController::barBar', $method_context); @@ -125,7 +125,7 @@ class MethodMutationTest extends TestCase }' ); - $file_checker = new FileChecker('somefile.php', $this->project_checker); + new FileChecker('somefile.php', $this->project_checker); $this->project_checker->scanFiles(); $method_context = new Context(); $this->project_checker->getMethodMutations('FooController::__construct', $method_context); @@ -161,7 +161,7 @@ class MethodMutationTest extends TestCase }' ); - $file_checker = new FileChecker('somefile.php', $this->project_checker); + new FileChecker('somefile.php', $this->project_checker); $this->project_checker->scanFiles(); $method_context = new Context(); $this->project_checker->getMethodMutations('FooController::__construct', $method_context); diff --git a/tests/ReportOutputTest.php b/tests/ReportOutputTest.php index 522d8c6ae..67d1ab6de 100644 --- a/tests/ReportOutputTest.php +++ b/tests/ReportOutputTest.php @@ -38,7 +38,7 @@ class ReportOutputTest extends TestCase { // No exception foreach (['.xml', '.txt', '.json', '.emacs'] as $extension) { - $checker = new \Psalm\Checker\ProjectChecker( + new \Psalm\Checker\ProjectChecker( $this->file_provider, new Provider\FakeParserCacheProvider(), false, @@ -61,7 +61,7 @@ class ReportOutputTest extends TestCase */ public function testReportFormatException() { - $checker = new \Psalm\Checker\ProjectChecker( + new \Psalm\Checker\ProjectChecker( $this->file_provider, new Provider\FakeParserCacheProvider(), false,