From fc41dd17438b6b30c5cbd236486857024f73550b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 9 Dec 2024 09:53:02 +0100 Subject: [PATCH] Fix `phpstan-type` declarations the syntax does not have a `=` --- src/CodeCoverage.php | 2 +- src/Data/ProcessedCodeCoverageData.php | 2 +- src/Driver/XdebugDriver.php | 16 ++++++++-------- src/Node/File.php | 8 ++++---- src/StaticAnalysis/FileAnalyser.php | 2 +- src/Target/Mapper.php | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/CodeCoverage.php b/src/CodeCoverage.php index 2dced8eff..1d4cacf13 100644 --- a/src/CodeCoverage.php +++ b/src/CodeCoverage.php @@ -38,7 +38,7 @@ /** * Provides collection functionality for PHP code coverage information. * - * @phpstan-type TestType = array{ + * @phpstan-type TestType array{ * size: string, * status: string, * } diff --git a/src/Data/ProcessedCodeCoverageData.php b/src/Data/ProcessedCodeCoverageData.php index 7bdf3426e..7378b75d9 100644 --- a/src/Data/ProcessedCodeCoverageData.php +++ b/src/Data/ProcessedCodeCoverageData.php @@ -24,7 +24,7 @@ * * @phpstan-import-type XdebugFunctionCoverageType from XdebugDriver * - * @phpstan-type TestIdType = string + * @phpstan-type TestIdType string */ final class ProcessedCodeCoverageData { diff --git a/src/Driver/XdebugDriver.php b/src/Driver/XdebugDriver.php index b57f737c3..b3cc222f9 100644 --- a/src/Driver/XdebugDriver.php +++ b/src/Driver/XdebugDriver.php @@ -34,8 +34,8 @@ * * @see https://xdebug.org/docs/code_coverage#xdebug_get_code_coverage * - * @phpstan-type XdebugLinesCoverageType = array - * @phpstan-type XdebugBranchCoverageType = array{ + * @phpstan-type XdebugLinesCoverageType array + * @phpstan-type XdebugBranchCoverageType array{ * op_start: int, * op_end: int, * line_start: int, @@ -44,21 +44,21 @@ * out: array, * out_hit: array, * } - * @phpstan-type XdebugPathCoverageType = array{ + * @phpstan-type XdebugPathCoverageType array{ * path: array, * hit: int, * } - * @phpstan-type XdebugFunctionCoverageType = array{ + * @phpstan-type XdebugFunctionCoverageType array{ * branches: array, * paths: array, * } - * @phpstan-type XdebugFunctionsCoverageType = array - * @phpstan-type XdebugPathAndBranchesCoverageType = array{ + * @phpstan-type XdebugFunctionsCoverageType array + * @phpstan-type XdebugPathAndBranchesCoverageType array{ * lines: XdebugLinesCoverageType, * functions: XdebugFunctionsCoverageType, * } - * @phpstan-type XdebugCodeCoverageWithoutPathCoverageType = array - * @phpstan-type XdebugCodeCoverageWithPathCoverageType = array + * @phpstan-type XdebugCodeCoverageWithoutPathCoverageType array + * @phpstan-type XdebugCodeCoverageWithPathCoverageType array */ final class XdebugDriver extends Driver { diff --git a/src/Node/File.php b/src/Node/File.php index 17df65d30..e7cbb5b2e 100644 --- a/src/Node/File.php +++ b/src/Node/File.php @@ -24,7 +24,7 @@ * * @phpstan-import-type LinesType from FileAnalyser * - * @phpstan-type ProcessedFunctionType = array{ + * @phpstan-type ProcessedFunctionType array{ * functionName: string, * namespace: string, * signature: string, @@ -41,7 +41,7 @@ * crap: int|string, * link: string * } - * @phpstan-type ProcessedMethodType = array{ + * @phpstan-type ProcessedMethodType array{ * methodName: string, * visibility: string, * signature: string, @@ -58,7 +58,7 @@ * crap: int|string, * link: string * } - * @phpstan-type ProcessedClassType = array{ + * @phpstan-type ProcessedClassType array{ * className: string, * namespace: string, * methods: array, @@ -74,7 +74,7 @@ * crap: int|string, * link: string * } - * @phpstan-type ProcessedTraitType = array{ + * @phpstan-type ProcessedTraitType array{ * traitName: string, * namespace: string, * methods: array, diff --git a/src/StaticAnalysis/FileAnalyser.php b/src/StaticAnalysis/FileAnalyser.php index c9c92718e..8aebac469 100644 --- a/src/StaticAnalysis/FileAnalyser.php +++ b/src/StaticAnalysis/FileAnalyser.php @@ -12,7 +12,7 @@ /** * @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage * - * @phpstan-type LinesType = array + * @phpstan-type LinesType array */ interface FileAnalyser { diff --git a/src/Target/Mapper.php b/src/Target/Mapper.php index e9fe948e4..f4bf8a796 100644 --- a/src/Target/Mapper.php +++ b/src/Target/Mapper.php @@ -14,9 +14,9 @@ use function sort; /** - * @phpstan-type TargetMap = array{namespaces: TargetMapPart, classes: TargetMapPart, classesThatExtendClass: TargetMapPart, classesThatImplementInterface: TargetMapPart, traits: TargetMapPart, methods: TargetMapPart, functions: TargetMapPart, reverseLookup: ReverseLookup} - * @phpstan-type TargetMapPart = array>> - * @phpstan-type ReverseLookup = array + * @phpstan-type TargetMap array{namespaces: TargetMapPart, classes: TargetMapPart, classesThatExtendClass: TargetMapPart, classesThatImplementInterface: TargetMapPart, traits: TargetMapPart, methods: TargetMapPart, functions: TargetMapPart, reverseLookup: ReverseLookup} + * @phpstan-type TargetMapPart array>> + * @phpstan-type ReverseLookup array * * @immutable *