Skip to content

Commit 8737c3b

Browse files
kukulichondrejmirtes
authored andcommitted
Removed useless @param, @return and @var annotations
1 parent 7bf2f0c commit 8737c3b

File tree

351 files changed

+10
-1738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

351 files changed

+10
-1738
lines changed

compiler/src/Process/DefaultProcessFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public function __construct()
1818

1919
/**
2020
* @param string[] $command
21-
* @param string $cwd
22-
* @return \PHPStan\Compiler\Process\Process
2321
*/
2422
public function create(array $command, string $cwd): Process
2523
{

compiler/src/Process/ProcessFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ interface ProcessFactory
99

1010
/**
1111
* @param string[] $command
12-
* @param string $cwd
13-
* @return \PHPStan\Compiler\Process\Process
1412
*/
1513
public function create(array $command, string $cwd): Process;
1614

compiler/src/Process/SymfonyProcess.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ final class SymfonyProcess implements Process
1212

1313
/**
1414
* @param string[] $command
15-
* @param string $cwd
16-
* @param \Symfony\Component\Console\Output\OutputInterface $output
1715
*/
1816
public function __construct(array $command, string $cwd, OutputInterface $output)
1917
{

phpcs.xml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
1919
<exclude name="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
2020
<exclude name="Consistence.Exceptions.ExceptionDeclaration"/>
21-
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/>
22-
<exclude name="Squiz.Commenting.FunctionComment.ParamNameNoMatch"/>
21+
<exclude name="Squiz.Commenting.FunctionComment"/>
2322
<exclude name="Squiz.PHP.Heredoc.NotAllowed"/>
2423
<exclude name="Squiz.WhiteSpace.FunctionSpacing.Before"/>
2524
</rule>
@@ -36,13 +35,22 @@
3635
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
3736
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification"/>
3837
</rule>
38+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation">
39+
<severity>10</severity>
40+
</rule>
3941
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
4042
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification"/>
4143
</rule>
44+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.UselessAnnotation">
45+
<severity>10</severity>
46+
</rule>
4247
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
4348
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification"/>
4449
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint"/>
4550
</rule>
51+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation">
52+
<severity>10</severity>
53+
</rule>
4654
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure.UnusedInheritedVariable">
4755
<exclude-pattern>src/Command/CommandHelper.php</exclude-pattern>
4856
<exclude-pattern>src/Testing/PHPStanTestCase.php</exclude-pattern>

src/Analyser/Analyser.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ public function __construct(
3535
* @param string[] $files
3636
* @param \Closure(string $file): void|null $preFileCallback
3737
* @param \Closure(int): void|null $postFileCallback
38-
* @param bool $debug
3938
* @param string[]|null $allAnalysedFiles
40-
* @return AnalyserResult
4139
*/
4240
public function analyse(
4341
array $files,

src/Analyser/AnalyserResult.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class AnalyserResult
2929
* @param string[] $internalErrors
3030
* @param array<string, array<string>>|null $dependencies
3131
* @param array<string, array<ExportedNode>> $exportedNodes
32-
* @param bool $reachedInternalErrorsCountLimit
3332
*/
3433
public function __construct(
3534
array $errors,

src/Analyser/ConditionalExpressionHolder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class ConditionalExpressionHolder
1515

1616
/**
1717
* @param array<string, Type> $conditionExpressionTypes
18-
* @param VariableTypeHolder $typeHolder
1918
*/
2019
public function __construct(
2120
array $conditionExpressionTypes,

src/Analyser/DirectScopeFactory.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,15 @@ public function __construct(
7272
}
7373

7474
/**
75-
* @param \PHPStan\Analyser\ScopeContext $context
76-
* @param bool $declareStrictTypes
7775
* @param array<string, Type> $constantTypes
7876
* @param \PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection|null $function
79-
* @param string|null $namespace
8077
* @param \PHPStan\Analyser\VariableTypeHolder[] $variablesTypes
8178
* @param \PHPStan\Analyser\VariableTypeHolder[] $moreSpecificTypes
8279
* @param array<string, ConditionalExpressionHolder[]> $conditionalExpressions
83-
* @param string|null $inClosureBindScopeClass
84-
* @param \PHPStan\Reflection\ParametersAcceptor|null $anonymousFunctionReflection
85-
* @param bool $inFirstLevelStatement
8680
* @param array<string, true> $currentlyAssignedExpressions
8781
* @param array<string, Type> $nativeExpressionTypes
8882
* @param array<\PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection> $inFunctionCallsStack
89-
* @param bool $afterExtractCall
90-
* @param Scope|null $parentScope
9183
*
92-
* @return MutatingScope
9384
*/
9485
public function create(
9586
ScopeContext $context,

src/Analyser/EnsuredNonNullabilityResult.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class EnsuredNonNullabilityResult
1111
private array $specifiedExpressions;
1212

1313
/**
14-
* @param MutatingScope $scope
1514
* @param EnsuredNonNullabilityResultExpression[] $specifiedExpressions
1615
*/
1716
public function __construct(MutatingScope $scope, array $specifiedExpressions)

src/Analyser/Error.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,8 @@ class Error implements \JsonSerializable
3434
/**
3535
* Error constructor.
3636
*
37-
* @param string $message
38-
* @param string $file
39-
* @param int|null $line
4037
* @param bool|\Throwable $canBeIgnored
41-
* @param string|null $filePath
42-
* @param string|null $traitFilePath
43-
* @param string|null $tip
44-
* @param int|null $nodeLine
4538
* @param class-string<\PhpParser\Node>|null $nodeType
46-
* @param string|null $identifier
4739
* @param mixed[] $metadata
4840
*/
4941
public function __construct(
@@ -223,7 +215,6 @@ public function jsonSerialize()
223215

224216
/**
225217
* @param mixed[] $json
226-
* @return self
227218
*/
228219
public static function decode(array $json): self
229220
{
@@ -244,7 +235,6 @@ public static function decode(array $json): self
244235

245236
/**
246237
* @param mixed[] $properties
247-
* @return self
248238
*/
249239
public static function __set_state(array $properties): self
250240
{

src/Analyser/ExpressionResult.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class ExpressionResult
2323
private ?MutatingScope $falseyScope = null;
2424

2525
/**
26-
* @param MutatingScope $scope
27-
* @param bool $hasYield
2826
* @param ThrowPoint[] $throwPoints
2927
* @param (callable(): MutatingScope)|null $truthyScopeCallback
3028
* @param (callable(): MutatingScope)|null $falseyScopeCallback

src/Analyser/FileAnalyser.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ public function __construct(
5050
}
5151

5252
/**
53-
* @param string $file
5453
* @param array<string, true> $analysedFiles
55-
* @param Registry $registry
5654
* @param callable(\PhpParser\Node $node, Scope $scope): void|null $outerNodeCallback
57-
* @return FileAnalyserResult
5855
*/
5956
public function analyseFile(
6057
string $file,
@@ -269,7 +266,6 @@ public function analyseFile(
269266
}
270267

271268
/**
272-
* @param Node $node
273269
* @return int[]
274270
*/
275271
private function getLinesToIgnore(Node $node): array
@@ -295,7 +291,6 @@ private function getLinesToIgnore(Node $node): array
295291
}
296292

297293
/**
298-
* @param string $file
299294
* @param \PhpParser\Node[] $nodes
300295
* @return array<string, array<int, true>>
301296
*/

src/Analyser/IgnoredError.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ public static function stringifyPattern($ignoredError): string
3333
}
3434

3535
/**
36-
* @param FileHelper $fileHelper
37-
* @param Error $error
38-
* @param string $ignoredErrorPattern
39-
* @param string|null $path
4036
* @return bool To ignore or not to ignore?
4137
*/
4238
public static function shouldIgnore(

src/Analyser/IgnoredErrorHelper.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ class IgnoredErrorHelper
1919
private bool $reportUnmatchedIgnoredErrors;
2020

2121
/**
22-
* @param IgnoredRegexValidator $ignoredRegexValidator
23-
* @param FileHelper $fileHelper
2422
* @param (string|mixed[])[] $ignoreErrors
25-
* @param bool $reportUnmatchedIgnoredErrors
2623
*/
2724
public function __construct(
2825
IgnoredRegexValidator $ignoredRegexValidator,
@@ -130,9 +127,7 @@ public function initialize(): IgnoredErrorHelperResult
130127
}
131128

132129
/**
133-
* @param string $regex
134130
* @param array<string, string> $ignoredTypes
135-
* @return string
136131
*/
137132
private function createIgnoredTypesError(string $regex, array $ignoredTypes): string
138133
{

src/Analyser/IgnoredErrorHelperResult.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ class IgnoredErrorHelperResult
2424
private bool $reportUnmatchedIgnoredErrors;
2525

2626
/**
27-
* @param FileHelper $fileHelper
2827
* @param string[] $errors
2928
* @param array<array<mixed>> $otherIgnoreErrors
3029
* @param array<string, array<array<mixed>>> $ignoreErrorsByFile
3130
* @param (string|mixed[])[] $ignoreErrors
32-
* @param bool $reportUnmatchedIgnoredErrors
3331
*/
3432
public function __construct(
3533
FileHelper $fileHelper,

src/Analyser/LazyScopeFactory.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,15 @@ public function __construct(
3636
}
3737

3838
/**
39-
* @param \PHPStan\Analyser\ScopeContext $context
40-
* @param bool $declareStrictTypes
4139
* @param array<string, Type> $constantTypes
4240
* @param \PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection|null $function
43-
* @param string|null $namespace
4441
* @param \PHPStan\Analyser\VariableTypeHolder[] $variablesTypes
4542
* @param \PHPStan\Analyser\VariableTypeHolder[] $moreSpecificTypes
4643
* @param array<string, ConditionalExpressionHolder[]> $conditionalExpressions
47-
* @param string|null $inClosureBindScopeClass
48-
* @param \PHPStan\Reflection\ParametersAcceptor|null $anonymousFunctionReflection
49-
* @param bool $inFirstLevelStatement
5044
* @param array<string, true> $currentlyAssignedExpressions
5145
* @param array<string, Type> $nativeExpressionTypes
5246
* @param array<\PHPStan\Reflection\FunctionReflection|\PHPStan\Reflection\MethodReflection> $inFunctionCallsStack
53-
* @param bool $afterExtractCall
54-
* @param Scope|null $parentScope
5547
*
56-
* @return MutatingScope
5748
*/
5849
public function create(
5950
ScopeContext $context,

0 commit comments

Comments
 (0)