1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00

fix phpdoc (#4905)

This commit is contained in:
orklah 2020-12-29 12:42:41 +01:00 committed by Daniil Gentili
parent bc900b2dd6
commit a475b23f0b
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
29 changed files with 4 additions and 90 deletions

View File

@ -40,7 +40,6 @@ class BadSqlTainter implements AfterExpressionAnalysisInterface
*
* @param PhpParser\Node\Expr $expr
* @param Context $context
* @param string[] $suppressed_issues
* @param FileManipulation[] $file_replacements
*
* @return void

View File

@ -175,8 +175,6 @@ class DocComment
/**
* Parse a docblock comment into its parts.
*
* @param bool $preserve_format
*/
public static function parsePreservingLength(\PhpParser\Comment\Doc $docblock) : ParsedDocblock
{

View File

@ -136,7 +136,6 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer
/**
* @param bool $add_mutations whether or not to add mutations to this method
* @param ?array<string, bool> $byref_uses
*
* @return false|null
*/
@ -1615,9 +1614,6 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer
/**
* Adds return types for the given function
*
* @param string $return_type
*
*/
public function addReturnTypes(Context $context): void
{

View File

@ -248,7 +248,6 @@ class ProjectAnalyzer
/**
* @param array<ReportOptions> $generated_report_options
* @param string $reports
*/
public function __construct(
Config $config,
@ -1043,10 +1042,6 @@ class ProjectAnalyzer
return $file_paths;
}
/**
* @param string $dir_name
*
*/
public function addProjectFile(string $file_path): void
{
$this->project_files[$file_path] = $file_path;

View File

@ -34,8 +34,6 @@ use function in_array;
class ElseIfAnalyzer
{
/**
* @param Context $elseif_context
*
* @return false|null
*/
public static function analyze(

View File

@ -552,8 +552,6 @@ class SwitchCaseAnalyzer
}
/**
* @param array<string, bool> $new_case_assigned_var_ids
* @param array<string, bool> $new_case_possibly_assigned_var_ids
* @return null|false
*/
private static function handleNonReturningCase(

View File

@ -2145,7 +2145,6 @@ class AssertionFinder
/**
* @param int $null_position
* @param array $if_types
* @return list<non-empty-array<string, non-empty-list<non-empty-list<string>>>>
*/
private static function getNullInequalityAssertions(

View File

@ -176,8 +176,6 @@ class FileManipulationBuffer
}
/**
* @param string $file_path
*
* @return array<string, FileManipulation[]>
*/
public static function getMigrationManipulations(FileProvider $file_provider): array

View File

@ -275,9 +275,6 @@ class FunctionDocblockManipulator
/**
* Sets a new param type
*
* @param bool $is_php_compatible
*
*/
public function setParamType(
string $param_name,

View File

@ -227,7 +227,7 @@ class TextDocument
* interface then a 'completionItem/resolve' request is sent with the selected completion item as a param. The
* returned completion item should have the documentation property filled in.
*
* @param TextDocumentIdentifier The text document
* @param TextDocumentIdentifier $textDocument The text document
* @param Position $position The position
* @psalm-return Promise<array<empty, empty>>|Promise<CompletionList>
*/

View File

@ -60,10 +60,6 @@ class MethodExistenceProvider
return isset(self::$handlers[strtolower($fq_classlike_name)]);
}
/**
* @param list<PhpParser\Node\Arg> $call_args
*
*/
public function doesMethodExist(
string $fq_classlike_name,
string $method_name_lowercase,

View File

@ -63,10 +63,6 @@ class MethodVisibilityProvider
return isset(self::$handlers[strtolower($fq_classlike_name)]);
}
/**
* @param list<PhpParser\Node\Arg> $call_args
*
*/
public function isMethodVisible(
StatementsSource $source,
string $fq_classlike_name,

View File

@ -64,10 +64,6 @@ class PropertyExistenceProvider
return isset(self::$handlers[strtolower($fq_classlike_name)]);
}
/**
* @param list<PhpParser\Node\Arg> $call_args
*
*/
public function doesPropertyExist(
string $fq_classlike_name,
string $property_name,

View File

@ -63,10 +63,6 @@ class PropertyTypeProvider
return isset(self::$handlers[strtolower($fq_classlike_name)]);
}
/**
* @param list<PhpParser\Node\Arg> $call_args
*
*/
public function getPropertyType(
string $fq_classlike_name,
string $property_name,

View File

@ -65,10 +65,6 @@ class PropertyVisibilityProvider
return isset(self::$handlers[strtolower($fq_classlike_name)]);
}
/**
* @param list<PhpParser\Node\Arg> $call_args
*
*/
public function isPropertyVisible(
StatementsSource $source,
string $fq_classlike_name,

View File

@ -552,8 +552,6 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler
}
/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
* @param positive-int $count
*/
private static function reconcileExactlyCountable(
@ -1478,10 +1476,6 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler
return Type::getMixed();
}
/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
*/
private static function reconcileInArray(
Codebase $codebase,
Union $existing_var_type,
@ -1522,10 +1516,6 @@ class SimpleAssertionReconciler extends \Psalm\Type\Reconciler
return $existing_var_type;
}
/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
*/
private static function reconcileHasArrayKey(
Union $existing_var_type,
string $assertion

View File

@ -31,7 +31,6 @@ use function substr;
class SimpleNegatedAssertionReconciler extends Reconciler
{
/**
* @param array<string, array<string, Type\Union>> $template_type_map
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
*
@ -234,10 +233,6 @@ class SimpleNegatedAssertionReconciler extends Reconciler
return null;
}
/**
* @param string[] $suppressed_issues
* @param 0|1|2 $failed_reconciliation
*/
private static function reconcileCallable(
Type\Union $existing_var_type
) : Type\Union {

View File

@ -13,10 +13,6 @@ interface PropertyTypeProviderInterface
*/
public static function getClassLikeNames() : array;
/**
* @param list<PhpParser\Node\Arg> $call_args
*
*/
public static function getPropertyType(
string $fq_classlike_name,
string $property_name,

View File

@ -69,9 +69,6 @@ abstract class Report
/**
* @param array<int, IssueData> $issues_data
* @param array<string, int> $fixable_issue_counts
* @param bool $use_color
* @param bool $show_snippet
* @param bool $show_info
*/
public function __construct(
array $issues_data,

View File

@ -172,10 +172,6 @@ abstract class Type
return $union;
}
/**
* @param int|null $value
*
*/
public static function getPositiveInt(bool $from_calculation = false): Union
{
$union = new Union([new Type\Atomic\TPositiveInt()]);

View File

@ -514,10 +514,8 @@ class Reconciler
/**
* Gets the type for a given (non-existent key) based on the passed keys
*
* @param array<string,Type\Union> $existing_keys
* @param array<string,mixed> $new_assertions
* @param string[][] $new_type_parts
*
* @param array<string,Type\Union> $existing_keys
* @param array<string,mixed> $new_assertions
*/
private static function getValueForKey(
Codebase $codebase,

View File

@ -927,7 +927,7 @@ function wordwrap(string $str, int $width = 75, string $break = "\n", bool $cut
/**
* @psalm-pure
*
* @param string|int|float $args
* @param string|int|float $values
*
* @psalm-flow ($format, $values) -> return
*/

View File

@ -45,10 +45,6 @@ class FooPropertyProvider implements
return true;
}
/**
* @param array<PhpParser\Node\Arg> $call_args
*
*/
public static function getPropertyType(
string $fq_classlike_name,
string $property_name,

View File

@ -23,8 +23,6 @@ class ClassConstantMoveTest extends \Psalm\Tests\TestCase
* @dataProvider providerValidCodeParse
*
* @param array<string, string> $constants_to_move
* @param array<string, string> $call_transforms
*
*/
public function testValidCode(
string $input_code,

View File

@ -23,8 +23,6 @@ class ClassMoveTest extends \Psalm\Tests\TestCase
* @dataProvider providerValidCodeParse
*
* @param array<string, string> $constants_to_move
* @param array<string, string> $call_transforms
*
*/
public function testValidCode(
string $input_code,

View File

@ -23,8 +23,6 @@ class MethodMoveTest extends \Psalm\Tests\TestCase
* @dataProvider providerValidCodeParse
*
* @param array<string, string> $methods_to_move
* @param array<string, string> $call_transforms
*
*/
public function testValidCode(
string $input_code,

View File

@ -23,8 +23,6 @@ class NamespaceMoveTest extends \Psalm\Tests\TestCase
* @dataProvider providerValidCodeParse
*
* @param array<string, string> $namespaces_to_move
* @param array<string, string> $call_transforms
*
*/
public function testValidCode(
string $input_code,

View File

@ -23,8 +23,6 @@ class PropertyMoveTest extends \Psalm\Tests\TestCase
* @dataProvider providerValidCodeParse
*
* @param array<string, string> $properties_to_move
* @param array<string, string> $call_transforms
*
*/
public function testValidCode(
string $input_code,

View File

@ -58,8 +58,6 @@ class IncludeTest extends TestCase
* @param array<int, string> $files_to_check
* @param array<string, string> $files
* @param string $error_message
* @param bool $hoist_constants
*
*/
public function testInvalidInclude(
array $files,