From 7728d69d4c513092ba940a510f70ef146044dbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Niedzielski?= Date: Wed, 17 Apr 2024 13:54:43 +0200 Subject: [PATCH] Added proper PHPStan declaration to `Ibexa\Contracts\Rest\Input\Parser::parse` https://github.com/ibexa/rest/pull/87 --- phpstan-baseline.neon | 75 ---------------------------------- src/contracts/Input/Parser.php | 3 +- 2 files changed, 1 insertion(+), 77 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 2804d8f6..a661bbdf 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -280,11 +280,6 @@ parameters: count: 1 path: src/contracts/Input/Handler.php - - - message: "#^Method Ibexa\\\\Contracts\\\\Rest\\\\Input\\\\Parser\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/contracts/Input/Parser.php - - message: "#^Cannot access offset mixed on Ibexa\\\\Contracts\\\\Rest\\\\Input\\\\Parser\\.$#" count: 1 @@ -2115,31 +2110,16 @@ parameters: count: 1 path: src/lib/Server/Input/Parser/Aggregation/AbstractRangeAggregationParser.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\AbstractRangeAggregationParser\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Aggregation/AbstractRangeAggregationParser.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\AbstractRangeAggregationParser\\:\\:parseAggregation\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 path: src/lib/Server/Input/Parser/Aggregation/AbstractRangeAggregationParser.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\AbstractStatsAggregationParser\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Aggregation/AbstractStatsAggregationParser.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\AbstractStatsAggregationParser\\:\\:parseAggregation\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 path: src/lib/Server/Input/Parser/Aggregation/AbstractStatsAggregationParser.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\AbstractTermAggregationParser\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Aggregation/AbstractTermAggregationParser.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\AbstractTermAggregationParser\\:\\:parseAggregation\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 @@ -2240,11 +2220,6 @@ parameters: count: 1 path: src/lib/Server/Input/Parser/Aggregation/ObjectStateTermAggregationParser.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\Range\\\\AbstractRangeParser\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Aggregation/Range/AbstractRangeParser.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Aggregation\\\\Range\\\\AbstractRangeParser\\:\\:visitRangeValue\\(\\) has no return type specified\\.$#" count: 1 @@ -2415,16 +2390,6 @@ parameters: count: 1 path: src/lib/Server/Input/Parser/Criterion/FullText.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\IsUserBased\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/IsUserBased.php - - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\IsUserEnabled\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/IsUserEnabled.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\LanguageCode\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 @@ -2495,11 +2460,6 @@ parameters: count: 1 path: src/lib/Server/Input/Parser/Criterion/ObjectStateId.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\ObjectStateIdentifier\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/ObjectStateIdentifier.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\Operator\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 @@ -2525,41 +2485,16 @@ parameters: count: 1 path: src/lib/Server/Input/Parser/Criterion/SectionId.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\SectionIdentifier\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/SectionIdentifier.php - - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\Sibling\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/Sibling.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\Subtree\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 path: src/lib/Server/Input/Parser/Criterion/Subtree.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\UserEmail\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/UserEmail.php - - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\UserId\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/UserId.php - - message: "#^Parameter \\#1 \\$value of class Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\Query\\\\Criterion\\\\UserId constructor expects array\\\\|int, array\\ given\\.$#" count: 1 path: src/lib/Server/Input/Parser/Criterion/UserId.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\UserLogin\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/Criterion/UserLogin.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Criterion\\\\UserMetadata\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" count: 1 @@ -2630,11 +2565,6 @@ parameters: count: 1 path: src/lib/Server/Input/Parser/FieldDefinitionUpdate.php - - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\JWTInput\\:\\:parse\\(\\) has parameter \\$data with no value type specified in iterable type array\\.$#" - count: 1 - path: src/lib/Server/Input/Parser/JWTInput.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Input\\\\Parser\\\\Limitation\\\\PathStringRouteBasedLimitationParser\\:\\:parseIdFromHref\\(\\) has parameter \\$limitationValue with no type specified\\.$#" count: 1 @@ -3585,11 +3515,6 @@ parameters: count: 1 path: src/lib/Server/Output/ValueObjectVisitor/Trash.php - - - message: "#^Access to protected property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\Content\\\\URLAlias\\:\\:\\$languageCodes\\.$#" - count: 1 - path: src/lib/Server/Output/ValueObjectVisitor/URLAlias.php - - message: "#^Method Ibexa\\\\Rest\\\\Server\\\\Output\\\\ValueObjectVisitor\\\\URLAlias\\:\\:visit\\(\\) has no return type specified\\.$#" count: 1 diff --git a/src/contracts/Input/Parser.php b/src/contracts/Input/Parser.php index 657d6d8a..1c67345b 100644 --- a/src/contracts/Input/Parser.php +++ b/src/contracts/Input/Parser.php @@ -14,8 +14,7 @@ abstract class Parser /** * Parse input structure. * - * @param array $data - * @param \Ibexa\Contracts\Rest\Input\ParsingDispatcher $parsingDispatcher + * @param array $data * * @return \Ibexa\Contracts\Core\Repository\Values\ValueObject|object */