1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

SlevomatCodingStandard.Commenting.DocCommentSpacing

This commit is contained in:
Jack Worman 2022-12-14 13:34:41 -06:00
parent 643542346b
commit 69658e8315
231 changed files with 104 additions and 267 deletions

View File

@ -261,8 +261,5 @@
<!-- Disallows empty comments. -->
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
<!-- <rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">-->
<!-- <properties>-->
<!-- </properties>-->
<!-- </rule>-->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing"/>
</ruleset>

View File

@ -54,7 +54,6 @@ final class Aliases
* @param array<lowercase-string, string> $functions_flipped
* @param array<string, string> $constants_flipped
* @internal
*
* @psalm-mutation-free
*/
public function __construct(

View File

@ -602,7 +602,6 @@ final class Codebase
/**
* @return CodeLocation[]
*
* @psalm-return array<int, CodeLocation>
*/
public function findReferencesToClassLike(string $fq_class_name): array
@ -782,7 +781,6 @@ final class Codebase
* a method, closure, or function.
*
* @param non-empty-string $function_id
*
* @return FunctionStorage|MethodStorage
*/
public function getFunctionLikeStorage(
@ -834,7 +832,6 @@ final class Codebase
/**
* @param string|MethodIdentifier $method_id
*
* @return array<int, FunctionLikeParameter>
*/
public function getMethodParams($method_id): array
@ -909,7 +906,6 @@ final class Codebase
/**
* @param string|MethodIdentifier $method_id
*
* @return array<string, MethodIdentifier>
*/
public function getOverriddenMethodIds($method_id): array
@ -1927,7 +1923,6 @@ final class Codebase
/**
* @param array<string> $taints
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function addTaintSource(
@ -1955,7 +1950,6 @@ final class Codebase
/**
* @param array<string> $taints
*
* @psalm-suppress PossiblyUnusedMethod
*/
public function addTaintSink(

View File

@ -169,6 +169,7 @@ class Config
/**
* These are special object classes that allow any and all properties to be get/set on them
*
* @var array<int, lowercase-string>
*/
protected $universal_object_crates;
@ -205,7 +206,6 @@ class Config
* The directory to store PHP Parser (and other) caches
*
* @internal
*
* @var string|null
*/
public $cache_directory;
@ -728,9 +728,9 @@ class Config
/**
* Creates a new config object from an XML string
*
* @param string|null $current_dir Current working directory, if different to $base_dir
* @param non-empty-string $file_contents
*
* @throws ConfigException
*/
public static function loadFromXML(
@ -769,7 +769,6 @@ class Config
/**
* @param non-empty-string $file_contents
*
* @throws ConfigException
*/
private static function validateXmlConfig(string $base_dir, string $file_contents): void
@ -939,12 +938,10 @@ class Config
/**
* @param non-empty-string $file_contents
*
* @psalm-suppress MixedMethodCall
* @psalm-suppress MixedAssignment
* @psalm-suppress MixedArgument
* @psalm-suppress MixedPropertyFetch
*
* @throws ConfigException
*/
private static function fromXmlAndPaths(
@ -1556,9 +1553,7 @@ class Config
/**
* @template T
*
* @param T::class $must_extend
*
* @return class-string<T>
*/
private function getPluginClassForPath(Codebase $codebase, string $path, string $must_extend): string

View File

@ -512,7 +512,6 @@ final class Context
/**
* @param array<string, Union> $new_vars_in_scope
*
* @return array<string, Union>
*/
public function getRedefinedVars(array $new_vars_in_scope, bool $include_new_vars = false): array
@ -635,9 +634,7 @@ final class Context
/**
* @param Clause[] $clauses
* @param array<string, bool> $changed_var_ids
*
* @return array{list<Clause>, list<Clause>}
*
* @psalm-pure
*/
public static function removeReconciledClauses(array $clauses, array $changed_var_ids): array
@ -666,7 +663,6 @@ final class Context
/**
* @param Clause[] $clauses
*
* @return list<Clause>
*/
public static function filterClauses(

View File

@ -34,8 +34,6 @@ final class ErrorBaseline
{
/**
* @param array<string,array<string,array{o:int, s:array<int, string>}>> $existingIssues
*
*
* @psalm-pure
*/
public static function countTotalIssues(array $existingIssues): int
@ -72,7 +70,6 @@ final class ErrorBaseline
/**
* @return array<string,array<string,array{o:int, s: list<string>}>>
*
* @throws ConfigException
*/
public static function read(FileProvider $fileProvider, string $baselineFile): array
@ -132,9 +129,7 @@ final class ErrorBaseline
/**
* @param array<string, list<IssueData>> $issues
*
* @return array<string, array<string, array{o: int, s: list<string>}>>
*
* @throws ConfigException
*/
public static function update(
@ -180,7 +175,6 @@ final class ErrorBaseline
/**
* @param array<string, list<IssueData>> $issues
*
* @return array<string,array<string,array{o:int, s:array<int, string>}>>
*/
private static function countIssueTypesByFile(array $issues): array
@ -192,7 +186,6 @@ final class ErrorBaseline
array_merge(...array_values($issues)),
/**
* @param array<string,array<string,array{o:int, s:array<int, string>}>> $carry
*
* @return array<string,array<string,array{o:int, s:array<int, string>}>>
*/
static function (array $carry, IssueData $issue): array {

View File

@ -26,9 +26,7 @@ class Algebra
{
/**
* @param array<string, non-empty-list<non-empty-list<Assertion>>> $all_types
*
* @return array<string, non-empty-list<non-empty-list<Assertion>>>
*
* @psalm-pure
*/
public static function negateTypes(array $all_types): array
@ -74,9 +72,7 @@ class Algebra
* (!$a) && (!$b) && ($a || $b || $c) => $c
*
* @param list<Clause> $clauses
*
* @return list<Clause>
*
* @psalm-pure
*/
public static function simplifyCNF(array $clauses): array
@ -330,7 +326,6 @@ class Algebra
* @param list<Clause> $clauses
* @param array<string, bool> $cond_referenced_var_ids
* @param array<string, array<int, array<int, Assertion>>> $active_truths
*
* @return array<string, list<list<Assertion>>>
*/
public static function getTruthsFromFormula(
@ -403,9 +398,7 @@ class Algebra
/**
* @param non-empty-list<Clause> $clauses
*
* @return list<Clause>
*
* @psalm-pure
*/
public static function groupImpossibilities(array $clauses): array
@ -522,9 +515,7 @@ class Algebra
/**
* @param list<Clause> $left_clauses
* @param list<Clause> $right_clauses
*
* @return list<Clause>
*
* @psalm-pure
*/
public static function combineOredClauses(
@ -645,7 +636,6 @@ class Algebra
* (!$a || !$c || !$f)
*
* @param list<Clause> $clauses
*
* @return non-empty-list<Clause>
*/
public static function negateFormula(array $clauses): array

View File

@ -297,7 +297,6 @@ class AttributesAnalyzer
/**
* @param iterable<AttributeGroup> $attribute_groups
*
* @return Generator<int, Attribute>
*/
private static function iterateAttributeNodes(iterable $attribute_groups): Generator

View File

@ -39,9 +39,7 @@ class CommentAnalyzer
/**
* @param array<string, array<string, Union>>|null $template_type_map
* @param array<string, TypeAlias> $type_aliases
*
* @throws DocblockParseException if there was a problem parsing the docblock
*
* @return list<VarDocblockComment>
*/
public static function getTypeFromComment(
@ -66,9 +64,7 @@ class CommentAnalyzer
/**
* @param array<string, array<string, Union>>|null $template_type_map
* @param array<string, TypeAlias> $type_aliases
*
* @return list<VarDocblockComment>
*
* @throws DocblockParseException if there was a problem parsing the docblock
*/
public static function arrayToDocblocks(
@ -260,9 +256,7 @@ class CommentAnalyzer
/**
* @throws DocblockParseException if an invalid string is found
*
* @return non-empty-list<string>
*
* @psalm-pure
*/
public static function splitDocLine(string $return_block): array

View File

@ -6,7 +6,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @psalm-immutable
*
* @internal
*/
class DataFlowNodeData

View File

@ -271,7 +271,6 @@ class FileAnalyzer extends SourceAnalyzer
/**
* @param array<int, PhpParser\Node\Stmt> $stmts
*
* @return list<PhpParser\Node\Stmt>
*/
public function populateCheckers(array $stmts): array

View File

@ -67,9 +67,7 @@ class ReturnTypeAnalyzer
* @param Closure|Function_|ClassMethod|ArrowFunction $function
* @param PhpParser\Node\Stmt[] $function_stmts
* @param string[] $compatible_method_ids
*
* @return false|null
*
* @psalm-suppress PossiblyUnusedReturnValue unused but seems important
* @psalm-suppress ComplexMethod Unavoidably complex method
*/
@ -781,7 +779,6 @@ class ReturnTypeAnalyzer
/**
* @param Closure|Function_|ClassMethod|ArrowFunction $function
*
* @return false|null
*/
public static function checkReturnType(

View File

@ -31,9 +31,7 @@ class ReturnTypeCollector
*
* @param array<PhpParser\Node> $stmts
* @param list<Union> $yield_types
*
* @return list<Union> a list of return types
*
* @psalm-suppress ComplexMethod to be refactored
*/
public static function getReturnTypes(

View File

@ -145,9 +145,7 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer
/**
* @param bool $add_mutations whether or not to add mutations to this method
*
* @return false|null
*
* @psalm-suppress PossiblyUnusedReturnValue unused but seems important
*/
public function analyze(

View File

@ -88,6 +88,7 @@ class MethodAnalyzer extends FunctionLikeAnalyzer
/**
* Determines whether a given method is static or not
*
* @param array<string> $suppressed_issues
*/
public static function checkStatic(

View File

@ -48,9 +48,7 @@ class MethodComparator
{
/**
* @param string[] $suppressed_issues
*
* @return false|null
*
* @psalm-suppress PossiblyUnusedReturnValue unused but seems important
*/
public static function compare(

View File

@ -153,7 +153,6 @@ class NamespaceAnalyzer extends SourceAnalyzer
* case-insensitive comparison. Identifiers can be namespaces, classlikes, functions, or methods.
*
* @psalm-pure
*
* @throws InvalidArgumentException if $identifier is not a valid identifier
*/
public static function isWithin(string $calling_identifier, string $identifier): bool
@ -187,9 +186,7 @@ class NamespaceAnalyzer extends SourceAnalyzer
* Identifiers can be namespaces, classlikes, functions, or methods.
*
* @psalm-pure
*
* @psalm-assert-if-false !empty $identifiers
*
* @param list<string> $identifiers
*/
public static function isWithinAny(string $calling_identifier, array $identifiers): bool
@ -210,7 +207,6 @@ class NamespaceAnalyzer extends SourceAnalyzer
/**
* @param non-empty-string $fullyQualifiedClassName e.g. '\Psalm\Internal\Analyzer\NamespaceAnalyzer'
* @return non-empty-string , e.g. 'Psalm'
*
* @psalm-pure
*/
public static function getNameSpaceRoot(string $fullyQualifiedClassName): string
@ -224,7 +220,6 @@ class NamespaceAnalyzer extends SourceAnalyzer
/**
* @return ($lowercase is true ? lowercase-string : string)
*
* @psalm-pure
*/
public static function normalizeIdentifier(string $identifier, bool $lowercase = true): string
@ -241,7 +236,6 @@ class NamespaceAnalyzer extends SourceAnalyzer
* Splits an identifier into parts, eg `Foo\Bar::baz` becomes ["Foo", "\\", "Bar", "::", "baz"].
*
* @return list<non-empty-string>
*
* @psalm-pure
*/
public static function getIdentifierParts(string $identifier): array

View File

@ -1199,7 +1199,6 @@ class ProjectAnalyzer
/**
* @param array<string> $diff_files
*
* @return array<string, string>
*/
public function getReferencedFilesFromDiff(array $diff_files, bool $include_referencing_files = true): array
@ -1415,6 +1414,7 @@ class ProjectAnalyzer
* Adapted from https://gist.github.com/divinity76/01ef9ca99c111565a72d3a8a6e42f7fb
* returns number of cpu cores
* Copyleft 2018, license: WTFPL
*
* @throws NumberOfCpuCoreNotFound
*/
public static function getCpuCount(): int
@ -1443,7 +1443,6 @@ class ProjectAnalyzer
/**
* @return array<int, string>
*
* @psalm-pure
*/
public static function getSupportedIssuesToFix(): array

View File

@ -31,9 +31,7 @@ class ScopeAnalyzer
* @param array<PhpParser\Node> $stmts
* @param list<'loop'|'switch'> $break_types
* @param bool $return_is_exit Exit and Throw statements are treated differently from return if this is false
*
* @return list<self::ACTION_*>
*
* @psalm-suppress ComplexMethod nothing much we can do
*/
public static function getControlActions(

View File

@ -119,7 +119,8 @@ abstract class SourceAnalyzer implements StatementsSource
/**
* Get a list of suppressed issues
*@psalm-mutation-free
*
* @psalm-mutation-free
* @return array<string>
*/
public function getSuppressedIssues(): array

View File

@ -387,7 +387,6 @@ class ForeachAnalyzer
/**
* @param PhpParser\Node\Stmt\Foreach_|PhpParser\Node\Expr\YieldFrom $stmt
*
* @return false|null
*/
public static function checkIteratorType(

View File

@ -50,7 +50,6 @@ class IfAnalyzer
{
/**
* @param array<string, Union> $pre_assignment_else_redefined_vars
*
* @return false|null
*/
public static function analyze(
@ -401,6 +400,7 @@ class IfAnalyzer
/**
* Returns all expressions inside an ored expression
*
* @return non-empty-list<PhpParser\Node\Expr>
*/
private static function getDefinitelyEvaluatedOredExpressions(PhpParser\Node\Expr $stmt): array

View File

@ -64,7 +64,6 @@ class IfElseAnalyzer
* (x: null)
* throw new Exception -- effects: remove null from the type of x
*
*
* @return null|false
*/
public static function analyze(

View File

@ -36,7 +36,6 @@ class LoopAnalyzer
* @param array<PhpParser\Node\Stmt> $stmts
* @param PhpParser\Node\Expr[] $pre_conditions
* @param PhpParser\Node\Expr[] $post_expressions
*
* @return false|null
*/
public static function analyze(
@ -568,7 +567,6 @@ class LoopAnalyzer
/**
* @param list<Clause> $pre_condition_clauses
*
* @return list<string>
*/
private static function applyPreConditionToLoopContext(

View File

@ -925,7 +925,6 @@ class AssertionFinder
/**
* @param PhpParser\Node\Expr\FuncCall|PhpParser\Node\Expr\MethodCall|PhpParser\Node\Expr\StaticCall $expr
*
* @return list<non-empty-array<string, non-empty-list<non-empty-list<Assertion>>>>
*/
protected static function processCustomAssertion(

View File

@ -92,7 +92,6 @@ class InstancePropertyAssignmentAnalyzer
/**
* @param PropertyFetch|PropertyProperty $stmt
* @param bool $direct_assignment whether the variable is assigned explicitly
*
* @return false|null
*/
public static function analyze(
@ -878,7 +877,6 @@ class InstancePropertyAssignmentAnalyzer
/**
* @param list<string> $invalid_assignment_types
*
* @psalm-suppress ComplexMethod Unavoidably complex method
*/
private static function analyzeAtomicAssignment(

View File

@ -100,7 +100,6 @@ class AssignmentAnalyzer
{
/**
* @param PhpParser\Node\Expr|null $assign_value This has to be null to support list destructuring
*
* @return false|Union
*/
public static function analyze(

View File

@ -292,7 +292,6 @@ class ArithmeticOpAnalyzer
/**
* @param string[] $invalid_left_messages
* @param string[] $invalid_right_messages
*
* @psalm-suppress ComplexMethod Unavoidably complex method.
*/
private static function analyzeOperands(

View File

@ -72,7 +72,6 @@ class ArgumentsAnalyzer
/**
* @param list<PhpParser\Node\Arg> $args
* @param array<int, FunctionLikeParameter>|null $function_params
*
* @return false|null
*/
public static function analyze(
@ -698,9 +697,7 @@ class ArgumentsAnalyzer
* @param list<PhpParser\Node\Arg> $args
* @param string|MethodIdentifier|null $method_id
* @param array<int,FunctionLikeParameter> $function_params
*
* @return false|null
*
* @psalm-suppress ComplexMethod there's just not much that can be done about this
*/
public static function checkArgumentsMatch(

View File

@ -134,7 +134,6 @@ class ArrayFunctionArgumentsAnalyzer
/**
* @param list<PhpParser\Node\Arg> $args
*
* @return false|null
*/
public static function handleAddition(
@ -329,7 +328,6 @@ class ArrayFunctionArgumentsAnalyzer
/**
* @param list<PhpParser\Node\Arg> $args
*
* @return false|null
*/
public static function handleSplice(

View File

@ -64,7 +64,6 @@ class AtomicMethodCallAnalyzer extends CallAnalyzer
{
/**
* @param TNamedObject|TTemplateParam|null $static_type
*
* @psalm-suppress ComplexMethod it's really complex, but unavoidably so
*/
public static function analyze(
@ -512,7 +511,6 @@ class AtomicMethodCallAnalyzer extends CallAnalyzer
/**
* @param TNamedObject|TTemplateParam $lhs_type_part
* @param array<string, Atomic> $intersection_types
*
* @return array{?Union, array<string>}
*/
private static function getIntersectionReturnType(

View File

@ -19,7 +19,6 @@ class MethodCallProhibitionAnalyzer
{
/**
* @param string[] $suppressed_issues
*
* @return false|null
*/
public static function analyze(

View File

@ -24,7 +24,6 @@ class MethodVisibilityAnalyzer
{
/**
* @param string[] $suppressed_issues
*
* @return false|null
*/
public static function analyze(

View File

@ -412,7 +412,6 @@ class MissingMethodCallHandler
*
* @param ClassLikeStorage $static_class_storage The called class
* @param lowercase-string $method_name_lc
*
* @return array{MethodStorage, ClassLikeStorage}
*/
private static function findPseudoMethodAndClassStorages(

View File

@ -1081,7 +1081,6 @@ class AtomicStaticCallAnalyzer
*
* @param ClassLikeStorage $static_class_storage The called class
* @param lowercase-string $method_name_lc
*
* @return array{MethodStorage, ClassLikeStorage}|null
*/
private static function findPseudoMethodAndClassStorages(
@ -1115,9 +1114,7 @@ class AtomicStaticCallAnalyzer
*
* @param string $virtual_var_name Temporary var name to use for create the fake MethodCall statement.
* @param bool $always_set_node_type If true, when the method has no declared typed, mixed will be set on node.
*
* @return bool Result of analysis. False if the call is invalid.
*
* @see MethodCallAnalyzer::analyze()
*/
private static function forwardCallToInstanceMethod(

View File

@ -493,7 +493,6 @@ class CallAnalyzer
/**
* @param PhpParser\Node\Scalar\String_|PhpParser\Node\Expr\Array_|PhpParser\Node\Expr\BinaryOp\Concat $callable_arg
*
* @return list<non-empty-string>
*/
public static function getFunctionIdsFromCallableArg(

View File

@ -1090,7 +1090,6 @@ class ArrayFetchAnalyzer
* @param TArray|TKeyedArray|TClassStringMap $type
* @param-out TArray|TKeyedArray|TClassStringMap $type
* @param list<TLiteralInt|TLiteralString> $key_values
*
* @psalm-suppress ConflictingReferenceConstraint Ignore
*/
private static function handleArrayAccessOnArray(

View File

@ -77,7 +77,6 @@ class AtomicPropertyFetchAnalyzer
{
/**
* @param array<string> $invalid_fetch_types $invalid_fetch_types
*
* @psalm-suppress ComplexMethod Unavoidably complex method.
*/
public static function analyze(

View File

@ -582,6 +582,7 @@ class ReturnAnalyzer
/**
* If a function returns a closure, we try to infer the param/return types of
* the inner closure.
*
* @see \Psalm\Tests\ReturnTypeTest:756
* @param PhpParser\Node\Expr\Closure|PhpParser\Node\Expr\ArrowFunction $expr
*/

View File

@ -168,7 +168,6 @@ class StatementsAnalyzer extends SourceAnalyzer
* Checks an array of statements for validity
*
* @param array<PhpParser\Node\Stmt> $stmts
*
* @return null|false
*/
public function analyze(

View File

@ -18,7 +18,6 @@ class TypeAnalyzer
*
* @param array<string, Union> $new_types
* @param array<string, Union> $existing_types
*
* @return array<string, Union>
*/
public static function combineKeyedTypes(array $new_types, array $existing_types): array

View File

@ -24,7 +24,6 @@ use const PHP_VERSION_ID;
/**
* @internal
*
* @psalm-immutable
*/
class Clause

View File

@ -132,7 +132,6 @@ final class CliUtils
foreach ($autoload_files as $file) {
/**
* @psalm-suppress UnresolvableInclude
*
* @var mixed
*/
$autoloader = require_once $file;
@ -255,7 +254,6 @@ final class CliUtils
/**
* @param string|array|null|false $f_paths
*
* @return list<string>|null
*/
public static function getPathsToCheck($f_paths): ?array

View File

@ -1568,7 +1568,6 @@ class ClassLikes
/**
* @param ReflectionProperty::IS_PUBLIC|ReflectionProperty::IS_PROTECTED|ReflectionProperty::IS_PRIVATE
* $visibility
*
* @return array<string, ClassConstantStorage>
*/
public function getConstantsForClass(string $class_name, int $visibility): array

View File

@ -58,7 +58,6 @@ abstract class DataFlowGraph
/**
* @param array<string> $previous_path_types
*
* @psalm-pure
*/
protected static function shouldIgnoreFetch(

View File

@ -228,7 +228,6 @@ class Functions
/**
* @param non-empty-string $function_name
*
* @return non-empty-string
*/
public function getFullyQualifiedFunctionNameFromString(string $function_name, StatementsSource $source): string

View File

@ -337,7 +337,6 @@ class Methods
/**
* @param list<PhpParser\Node\Arg> $args
*
* @return list<FunctionLikeParameter>
*/
public function getMethodParams(

View File

@ -355,7 +355,6 @@ class Reflection
/**
* @param callable-string $function_id
*
* @return false|null
*/
public function registerFunction(string $function_id): ?bool

View File

@ -8,7 +8,6 @@ use function strtolower;
/**
* @psalm-consistent-constructor
*
* @internal
*/
class DataFlowNode

View File

@ -6,7 +6,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @psalm-immutable
*
* @internal
*/
class Path

View File

@ -27,7 +27,6 @@ class AstDiffer
* @param Closure(Stmt, Stmt, string, string, bool=): bool $is_equal
* @param array<int, Stmt> $a
* @param array<int, Stmt> $b
*
* @return array{0:non-empty-list<array<int, int>>, 1: int, 2: int, 3: array<int, bool>}
*/
protected static function calculateTrace(
@ -79,9 +78,7 @@ class AstDiffer
* @param array<int, Stmt> $a
* @param array<int, Stmt> $b
* @param array<int, bool> $bc
*
* @return list<DiffElem>
*
* @psalm-pure
*/
protected static function extractDiff(array $trace, int $x, int $y, array $a, array $b, array $bc): array

View File

@ -21,7 +21,6 @@ class ClassStatementsDiffer extends AstDiffer
*
* @param array<int, PhpParser\Node\Stmt> $a
* @param array<int, PhpParser\Node\Stmt> $b
*
* @return array{
* 0: list<string>,
* 1: list<string>,

View File

@ -8,7 +8,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @internal
*
* @psalm-immutable
*/
class DiffElem

View File

@ -28,9 +28,7 @@ class FileDiffer
/**
* @param list<string> $a
* @param list<string> $b
*
* @return array{0:non-empty-list<array<int, int>>, 1: int, 2: int}
*
* @psalm-pure
*/
private static function calculateTrace(
@ -72,9 +70,7 @@ class FileDiffer
* @param list<array<int, int>> $trace
* @param list<string> $a
* @param list<string> $b
*
* @return list<DiffElem>
*
* @psalm-pure
*/
private static function extractDiff(array $trace, int $x, int $y, array $a, array $b): array
@ -125,7 +121,6 @@ class FileDiffer
/**
* @return array<int, array{0: int, 1: int, 2: int, 3: int, 4: int, 5: string}>
*
* @psalm-pure
*/
public static function getDiff(string $a_code, string $b_code): array
@ -273,9 +268,7 @@ class FileDiffer
* Coalesce equal-length sequences of remove+add into a replace operation.
*
* @param DiffElem[] $diff
*
* @return list<DiffElem>
*
* @psalm-pure
*/
private static function coalesceReplacements(array $diff): array

View File

@ -15,9 +15,9 @@ class FileStatementsDiffer extends AstDiffer
{
/**
* Calculate diff (edit script) from $a to $b.
*
* @param list<PhpParser\Node\Stmt> $a
* @param list<PhpParser\Node\Stmt> $b
*
* @return array{
* 0: list<string>,
* 1: list<string>,

View File

@ -15,9 +15,9 @@ class NamespaceStatementsDiffer extends AstDiffer
{
/**
* Calculate diff (edit script) from $a to $b.
*
* @param array<int, PhpParser\Node\Stmt> $a
* @param array<int, PhpParser\Node\Stmt> $b
*
* @return array{
* 0: list<string>,
* 1: list<string>,

View File

@ -18,7 +18,6 @@ use const JSON_THROW_ON_ERROR;
* Environment variables collector for CI environment.
*
* @author Kitamura Satoshi <with.no.parachute@gmail.com>
*
* @internal
*/
class BuildInfoCollector
@ -68,7 +67,6 @@ class BuildInfoCollector
* "TRAVIS", "TRAVIS_JOB_ID" must be set.
*
* @return $this
*
* @psalm-suppress PossiblyUndefinedStringArrayOffset
*/
protected function fillTravisCi(): self
@ -145,7 +143,6 @@ class BuildInfoCollector
* "APPVEYOR", "APPVEYOR_BUILD_NUMBER" must be set.
*
* @psalm-suppress PossiblyUndefinedStringArrayOffset
*
* @return $this
*/
protected function fillAppVeyor(): self
@ -217,7 +214,6 @@ class BuildInfoCollector
* "JENKINS_URL", "BUILD_NUMBER" must be set.
*
* @psalm-suppress PossiblyUndefinedStringArrayOffset
*
* @return $this
*/
protected function fillScrutinizer(): self

View File

@ -19,7 +19,6 @@ use function trim;
* Git repository info collector.
*
* @author Kitamura Satoshi <with.no.parachute@gmail.com>
*
* @internal
*/
class GitInfoCollector
@ -100,7 +99,6 @@ class GitInfoCollector
* Collect remotes info.
*
* @throws RuntimeException
*
* @return list<RemoteInfo>
*/
protected function collectRemotes(): array

View File

@ -11,7 +11,6 @@ use function sprintf;
/**
* @author Kitamura Satoshi <with.no.parachute@gmail.com>
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
*
* @internal
*/
final class SystemCommandExecutor
@ -19,9 +18,7 @@ final class SystemCommandExecutor
/**
* Execute command.
*
*
* @throws RuntimeException
*
* @return string[]
*/
public function execute(string $command): array

View File

@ -6,7 +6,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @psalm-immutable
*
* @internal
*/
class CodeMigration

View File

@ -6,7 +6,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @psalm-immutable
*
* @internal
*/
class ForkProcessDoneMessage implements ForkMessage

View File

@ -6,7 +6,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @psalm-immutable
*
* @internal
*/
class ForkProcessErrorMessage implements ForkMessage

View File

@ -6,7 +6,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @psalm-immutable
*
* @internal
*/
class ForkTaskDoneMessage implements ForkMessage

View File

@ -107,7 +107,6 @@ class Pool
* A closure to execute upon shutting down a child
* @param Closure(mixed $data):void $task_done_closure
* A closure to execute when a task is done
*
* @psalm-suppress MixedAssignment
*/
public function __construct(
@ -278,7 +277,6 @@ class Pool
* return the stream the parent will use to read results.
*
* @param resource[] $sockets the socket pair for IPC
*
* @return resource
*/
private static function streamForParent(array $sockets)
@ -304,7 +302,6 @@ class Pool
* the stream the child will use to write results.
*
* @param resource[] $sockets the socket pair for IPC
*
* @return resource
*/
private static function streamForChild(array $sockets)
@ -323,9 +320,7 @@ class Pool
* The results are returned in an array, one for each worker. The order of the results
* is not maintained.
*
*
* @psalm-suppress MixedAssignment
*
* @return list<mixed>
*/
private function readResultsFromChildren(): array
@ -392,6 +387,7 @@ class Pool
foreach ($this->child_pid_list as $child_pid) {
/**
* SIGTERM does not exist on windows
*
* @psalm-suppress UnusedPsalmSuppress
* @psalm-suppress UndefinedConstant
* @psalm-suppress MixedArgument
@ -448,6 +444,7 @@ class Pool
if ($process_lookup) {
/**
* SIGALRM does not exist on windows
*
* @psalm-suppress UnusedPsalmSuppress
* @psalm-suppress UndefinedConstant
* @psalm-suppress MixedArgument
@ -466,6 +463,7 @@ class Pool
/**
* SIGALRM does not exist on windows
*
* @psalm-suppress UnusedPsalmSuppress
* @psalm-suppress UndefinedConstant
*/

View File

@ -30,6 +30,7 @@ class PsalmRestarter extends XdebugHandler
/**
* No type hint to allow xdebug-handler v1 and v2 usage
*
* @param bool $default
*/
protected function requiresRestart($default): bool
@ -44,6 +45,7 @@ class PsalmRestarter extends XdebugHandler
/**
* No type hint to allow xdebug-handler v1 and v2 usage
*
* @param string|string[] $command
*/
protected function restart($command): void

View File

@ -27,8 +27,6 @@ class Json
/**
* @param mixed $data
*
*
* @psalm-pure
*/
public static function encode($data, ?int $options = null): string

View File

@ -49,9 +49,7 @@ class TextDocument
* to request the current content of a text document identified by the URI
*
* @param TextDocumentIdentifier $textDocument The document to get the content for
*
* @return Promise<TextDocumentItem> The document's current content
*
* @psalm-suppress MixedReturnTypeCoercion due to Psalm bug
*/
public function xcontent(TextDocumentIdentifier $textDocument): Promise

View File

@ -38,7 +38,6 @@ class ClientHandler
*
* @param string $method The method to call
* @param array|object $params The method parameters
*
* @return Promise<mixed> Resolved with the result of the request or rejected with an error
*/
public function request(string $method, $params): Promise

View File

@ -65,6 +65,7 @@ interface EmitterInterface
*
* If the listener could not be found, this method will return false. If it
* was removed it will return true.
*
* @psalm-suppress PossiblyUnusedReturnValue
*/
public function removeListener(string $eventName, callable $listener): bool;

View File

@ -99,6 +99,7 @@ class LanguageServer extends Dispatcher
/**
* This should actually be a private property on `parent`
*
* @psalm-suppress UnusedProperty
*/
protected JsonMapper $mapper;
@ -425,6 +426,7 @@ class LanguageServer extends Dispatcher
* The shutdown request is sent from the client to the server. It asks the server to shut down,
* but to not exit (otherwise the response might not be delivered correctly to the client).
* There is a separate exit notification that asks the server to exit.
*
* @psalm-suppress PossiblyUnusedReturnValue
*/
public function shutdown(): Promise

View File

@ -28,7 +28,6 @@ class Message
/**
* Parses a message
*
*
* @psalm-suppress UnusedMethod
*/
public static function parse(string $msg): Message

View File

@ -11,7 +11,6 @@ interface ProtocolWriter
/**
* Sends a Message to the client
*
*
* @return Promise Resolved when the message has been fully written out to the output stream
*/
public function write(Message $msg): Promise;

View File

@ -13,7 +13,6 @@ use function strtolower;
/**
* @psalm-immutable
*
* @internal
*/
class MethodIdentifier
@ -38,7 +37,6 @@ class MethodIdentifier
* it into a MethodIdentifier
*
* @param string|MethodIdentifier $method_id
*
* @psalm-pure
*/
public static function wrap($method_id): self

View File

@ -27,7 +27,6 @@ class CustomTraverser extends NodeTraverser
* Recursively traverse a node.
*
* @param Node $node node to traverse
*
* @return Node Result of traversal (may be original node or new one)
*/
protected function traverseNode(Node $node): Node
@ -97,7 +96,6 @@ class CustomTraverser extends NodeTraverser
* Recursively traverse array (usually of nodes).
*
* @param array $nodes Array to traverse
*
* @return array Result of traversal (may be original array or changed one)
*/
protected function traverseArray(array $nodes): array

View File

@ -488,7 +488,6 @@ class ClassLikeDocblockParser
* @param array<string, array<int, string>> $specials
* @param 'property'|'psalm-property'|'property-read'|
* 'psalm-property-read'|'property-write'|'psalm-property-write' $property_tag
*
* @throws DocblockParseException
*/
protected static function addMagicPropertyToInfo(

View File

@ -1768,9 +1768,7 @@ class ClassLikeNodeScanner
/**
* @param array<string, TypeAlias> $type_aliases
*
* @return array<string, InlineTypeAlias>
*
* @throws DocblockParseException if there was a problem parsing the docblock
*/
public static function getTypeAliasesFromComment(
@ -1801,9 +1799,7 @@ class ClassLikeNodeScanner
/**
* @param array<string> $type_alias_comment_lines
* @param array<string, TypeAlias> $type_aliases
*
* @return array<string, InlineTypeAlias>
*
* @throws DocblockParseException if there was a problem parsing the docblock
*/
private static function getTypeAliasesFromCommentLines(

View File

@ -664,8 +664,6 @@ class FunctionLikeDocblockParser
/**
* @param array<int, string> $param
*
*
* @throws DocblockParseException if a duplicate is found
*/
private static function checkDuplicatedParams(array $param): void
@ -679,9 +677,7 @@ class FunctionLikeDocblockParser
/**
* @param array<int, string> $lines
*
* @return list<string>
*
* @psalm-pure
*/
private static function extractAllParamNames(array $lines): array

View File

@ -423,7 +423,6 @@ class FunctionLikeDocblockScanner
* @param array<string, array<string, Union>> $template_types
* @param array<string, TypeAlias>|null $type_aliases
* @param array<string, array<string, Union>> $function_template_types
*
* @return array{
* array<int, array{0: string, 1: int, 2?: string}>,
* array<string, array<string, Union>>

View File

@ -123,7 +123,6 @@ class FunctionLikeNodeScanner
/**
* @param bool $fake_method in the case of @method annotations we do something a little strange
*
* @return FunctionStorage|MethodStorage|false
*/
public function start(PhpParser\Node\FunctionLike $stmt, bool $fake_method = false)

View File

@ -198,7 +198,6 @@ class SimpleNameResolver extends NodeVisitorAbstract
*
* @param Name $name Function or constant name to resolve
* @param Stmt\Use_::TYPE_* $type One of Stmt\Use_::TYPE_*
*
* @return Name Resolved name, or original name with attribute
*/
protected function resolveName(Name $name, int $type): Name

View File

@ -28,12 +28,10 @@ class ComposerLock
/**
* @param mixed $package
*
* @psalm-assert-if-true array{
* name: string,
* extra: array{psalm: array{pluginClass: string}}
* } $package
*
* @psalm-pure
*/
public function isPlugin($package): bool

View File

@ -61,7 +61,6 @@ class FakeFileProvider extends FileProvider
/**
* @param array<string> $file_extensions
* @param null|callable(string):bool $filter
*
* @return list<string>
*/
public function getFilesInDir(string $dir_path, array $file_extensions, callable $filter = null): array

View File

@ -126,7 +126,6 @@ class FileProvider
/**
* @param array<string> $file_extensions
* @param null|callable(string):bool $filter
*
* @return list<string>
*/
public function getFilesInDir(string $dir_path, array $file_extensions, callable $filter = null): array

View File

@ -27,7 +27,6 @@ use const LOCK_EX;
*
* Used to determine which files reference other files, necessary for using the --diff
* option from the command line.
*
* @internal
*/
class FileReferenceCacheProvider

View File

@ -21,7 +21,6 @@ use function file_exists;
*
* Used to determine which files reference other files, necessary for using the --diff
* option from the command line.
*
* @internal
*/
class FileReferenceProvider

View File

@ -58,7 +58,6 @@ class FunctionParamsProvider
/**
* @param list<Arg> $call_args
*
* @return ?array<int, FunctionLikeParameter>
*/
public function getFunctionParams(

View File

@ -65,7 +65,6 @@ class MethodParamsProvider
/**
* @param ?list<Arg> $call_args
*
* @return ?list<FunctionLikeParameter>
*/
public function getMethodParams(

View File

@ -394,7 +394,6 @@ class StatementsProvider
/**
* @param list<Stmt> $existing_statements
* @param array<int, array{0: int, 1: int, 2: int, 3: int, 4: int, 5: string}> $file_changes
*
* @return list<Stmt>
*/
public static function parseStatements(

View File

@ -6,7 +6,6 @@ use Psalm\Internal\Scanner\UnresolvedConstantComponent;
/**
* @psalm-immutable
*
* @internal
*/
class ArrayOffsetFetch extends UnresolvedConstantComponent

View File

@ -6,7 +6,6 @@ use Psalm\Internal\Scanner\UnresolvedConstantComponent;
/**
* @psalm-immutable
*
* @internal
*/
class ArraySpread extends UnresolvedConstantComponent

View File

@ -6,7 +6,6 @@ use Psalm\Internal\Scanner\UnresolvedConstantComponent;
/**
* @psalm-immutable
*
* @internal
*/
class ArrayValue extends UnresolvedConstantComponent

View File

@ -6,7 +6,6 @@ use Psalm\Internal\Scanner\UnresolvedConstantComponent;
/**
* @psalm-immutable
*
* @internal
*/
class ClassConstant extends UnresolvedConstantComponent

View File

@ -6,7 +6,6 @@ use Psalm\Internal\Scanner\UnresolvedConstantComponent;
/**
* @psalm-immutable
*
* @internal
*/
class Constant extends UnresolvedConstantComponent

View File

@ -6,7 +6,6 @@ use Psalm\Internal\Scanner\UnresolvedConstantComponent;
/**
* @psalm-immutable
*
* @internal
*/
class KeyValuePair extends UnresolvedConstantComponent

View File

@ -6,7 +6,6 @@ use Psalm\Internal\Scanner\UnresolvedConstantComponent;
/**
* @psalm-immutable
*
* @internal
*/
class ScalarValue extends UnresolvedConstantComponent

View File

@ -4,7 +4,6 @@ namespace Psalm\Internal\Scanner\UnresolvedConstant;
/**
* @psalm-immutable
*
* @internal
*/
class UnresolvedAdditionOp extends UnresolvedBinaryOp

View File

@ -7,7 +7,6 @@ use Psalm\Storage\ImmutableNonCloneableTrait;
/**
* @psalm-immutable
*
* @internal
*/
abstract class UnresolvedBinaryOp extends UnresolvedConstantComponent

View File

@ -4,7 +4,6 @@ namespace Psalm\Internal\Scanner\UnresolvedConstant;
/**
* @psalm-immutable
*
* @internal
*/
class UnresolvedBitwiseAnd extends UnresolvedBinaryOp

View File

@ -4,7 +4,6 @@ namespace Psalm\Internal\Scanner\UnresolvedConstant;
/**
* @psalm-immutable
*
* @internal
*/
class UnresolvedBitwiseOr extends UnresolvedBinaryOp

View File

@ -4,7 +4,6 @@ namespace Psalm\Internal\Scanner\UnresolvedConstant;
/**
* @psalm-immutable
*
* @internal
*/
class UnresolvedBitwiseXor extends UnresolvedBinaryOp

Some files were not shown because too many files have changed in this diff Show More