Skip to content

Commit c5c4ee5

Browse files
Add phpdoc for array
1 parent 502c0e2 commit c5c4ee5

File tree

11 files changed

+44
-12
lines changed

11 files changed

+44
-12
lines changed

phpstan.neon.dist

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ parameters:
3535
- src/*/vendor/*
3636
# Symfony 6 support
3737
- src/Symfony/Bundle/ArgumentResolver/CompatibleValueResolverInterface.php
38-
- tests/Fixtures/app/config/reference.php
3938
earlyTerminatingMethodCalls:
4039
PHPUnit\Framework\Constraint\Constraint:
4140
- fail
@@ -113,6 +112,22 @@ parameters:
113112
# Level 6
114113
-
115114
identifier: missingType.iterableValue
115+
paths:
116+
- src/Doctrine/Common/Tests
117+
- src/Doctrine/Odm/Tests
118+
- src/Doctrine/Orm/Tests
119+
- src/Elasticsearch/Tests
120+
- src/GraphQl/Tests
121+
- src/Hydra/Tests
122+
- src/JsonApi/Tests
123+
- src/JsonSchema/Tests
124+
- src/Metadata/Tests
125+
- src/OpenApi/Tests
126+
- src/Serializer/Tests
127+
- src/State/Tests
128+
- src/Symfony/Tests
129+
- tests
130+
- src # TODO
116131
-
117132
identifier: missingType.generics
118133
-

src/JsonSchema/DefinitionNameFactoryInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ interface DefinitionNameFactoryInterface
2525
/**
2626
* Creates a resource definition name.
2727
*
28-
* @param class-string $className
28+
* @param class-string $className
29+
* @param array<string, mixed> $serializerContext
2930
*
3031
* @return string the definition name
3132
*/

src/JsonSchema/SchemaFactoryInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ interface SchemaFactoryInterface
2626

2727
/**
2828
* Builds the JSON Schema document corresponding to the given PHP class.
29+
*
30+
* @param array<string, mixed>|null $serializerContext
2931
*/
3032
public function buildSchema(string $className, string $format = 'json', string $type = Schema::TYPE_OUTPUT, ?Operation $operation = null, ?Schema $schema = null, ?array $serializerContext = null, bool $forceCollection = false): Schema;
3133
}

src/Metadata/Exception/HttpExceptionInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public function getStatusCode(): int;
2222

2323
/**
2424
* Returns response headers.
25+
*
26+
* @return array<string, string>
2527
*/
2628
public function getHeaders(): array;
2729
}

src/Metadata/Extractor/PropertyExtractorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ interface PropertyExtractorInterface
2626
* Parses all metadata files and convert them in an array.
2727
*
2828
* @throws InvalidArgumentException
29+
*
30+
* @return array<string, array<string, array<string, mixed>>>
2931
*/
3032
public function getProperties(): array;
3133
}

src/Metadata/UriVariableTransformerInterface.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ interface UriVariableTransformerInterface
2020
/**
2121
* Transforms the value of a URI variable (identifier) to its type.
2222
*
23-
* @param mixed $value The URI variable value to transform
24-
* @param array $types The guessed type behind the URI variable
25-
* @param array $context Options available to the transformer
23+
* @param mixed $value The URI variable value to transform
24+
* @param array<string> $types The guessed type behind the URI variable
25+
* @param array<string, mixed> $context Options available to the transformer
2626
*
2727
* @throws InvalidUriVariableException Occurs when the URI variable could not be transformed
2828
*
@@ -33,9 +33,9 @@ public function transform(mixed $value, array $types, array $context = []);
3333
/**
3434
* Checks whether the value of a URI variable can be transformed to its type by this transformer.
3535
*
36-
* @param mixed $value The URI variable value to transform
37-
* @param array $types The types to which the URI variable value should be transformed
38-
* @param array $context Options available to the transformer
36+
* @param mixed $value The URI variable value to transform
37+
* @param array<string> $types The types to which the URI variable value should be transformed
38+
* @param array<string, mixed> $context Options available to the transformer
3939
*/
4040
public function supportsTransformation(mixed $value, array $types, array $context = []): bool;
4141
}

src/Metadata/UriVariablesConverterInterface.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ interface UriVariablesConverterInterface
2626
/**
2727
* Takes an array of strings representing URI variables (identifiers) and transform their values to the expected type.
2828
*
29-
* @param array $data URI variables to convert to PHP values
30-
* @param string $class The class to which the URI variables belong to
29+
* @param array<string, mixed> $data URI variables to convert to PHP values
30+
* @param string $class The class to which the URI variables belong to
31+
* @param array<string, mixed> $context
3132
*
3233
* @throws InvalidIdentifierException
3334
* @throws InvalidUriVariableException
3435
*
35-
* @return array Array indexed by identifiers properties with their values denormalized
36+
* @return array<string, mixed> Array indexed by identifiers properties with their values denormalized
3637
*/
3738
public function convert(array $data, string $class, array $context = []): array;
3839
}

src/Serializer/Filter/FilterInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ interface FilterInterface extends BaseFilterInterface
2525
{
2626
/**
2727
* Apply a filter to the serializer context.
28+
*
29+
* @param array<string, mixed> $attributes
30+
* @param array<string, mixed> $context
31+
*
32+
* @param-out array<string, mixed> $context
2833
*/
2934
public function apply(Request $request, bool $normalization, array $attributes, array &$context): void;
3035
}

src/State/SerializerContextBuilderInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ interface SerializerContextBuilderInterface
3030
/**
3131
* Creates a serialization context from a Request.
3232
*
33+
* @param array<string, mixed>|null $extractedAttributes
34+
*
3335
* @throws RuntimeException
3436
*
3537
* @return array<string, mixed>

src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaRestrictionMetadataInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface PropertySchemaRestrictionMetadataInterface
3131
* @param Constraint $constraint The validation constraint
3232
* @param ApiProperty $propertyMetadata The property metadata
3333
*
34-
* @return array The array of restrictions
34+
* @return array<string, mixed> The array of restrictions
3535
*/
3636
public function create(Constraint $constraint, ApiProperty $propertyMetadata): array;
3737

0 commit comments

Comments
 (0)