Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,22 @@ parameters:
# Level 6
-
identifier: missingType.iterableValue
paths:
- src/Doctrine/Common/Tests
- src/Doctrine/Odm/Tests
- src/Doctrine/Orm/Tests
- src/Elasticsearch/Tests
- src/GraphQl/Tests
- src/Hydra/Tests
- src/JsonApi/Tests
- src/JsonSchema/Tests
- src/Metadata/Tests
- src/OpenApi/Tests
- src/Serializer/Tests
- src/State/Tests
- src/Symfony/Tests
- tests
- src # TODO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really want to add src here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is currently 1500 errors of missingType.iterableValue so I cannot fix all of them
I thought it could be interesting that one day all the existing array from /src folder are described by a PHPdoc no? So currently src is ignored (which is already the case) and one day it won't. WDYT ?

-
identifier: missingType.generics
-
Expand Down
3 changes: 2 additions & 1 deletion src/JsonSchema/DefinitionNameFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ interface DefinitionNameFactoryInterface
/**
* Creates a resource definition name.
*
* @param class-string $className
* @param class-string $className
* @param array<string, mixed> $serializerContext
*
* @return string the definition name
*/
Expand Down
2 changes: 2 additions & 0 deletions src/JsonSchema/SchemaFactoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ interface SchemaFactoryInterface

/**
* Builds the JSON Schema document corresponding to the given PHP class.
*
* @param array<string, mixed>|null $serializerContext
*/
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;
}
2 changes: 2 additions & 0 deletions src/Metadata/Exception/HttpExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public function getStatusCode(): int;

/**
* Returns response headers.
*
* @return array<string, string>
*/
public function getHeaders(): array;
}
2 changes: 2 additions & 0 deletions src/Metadata/Extractor/PropertyExtractorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ interface PropertyExtractorInterface
* Parses all metadata files and convert them in an array.
*
* @throws InvalidArgumentException
*
* @return array<string, array<string, array<string, mixed>>>
*/
public function getProperties(): array;
}
12 changes: 6 additions & 6 deletions src/Metadata/UriVariableTransformerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ interface UriVariableTransformerInterface
/**
* Transforms the value of a URI variable (identifier) to its type.
*
* @param mixed $value The URI variable value to transform
* @param array $types The guessed type behind the URI variable
* @param array $context Options available to the transformer
* @param mixed $value The URI variable value to transform
* @param array<string> $types The guessed type behind the URI variable
* @param array<string, mixed> $context Options available to the transformer
*
* @throws InvalidUriVariableException Occurs when the URI variable could not be transformed
*
Expand All @@ -33,9 +33,9 @@ public function transform(mixed $value, array $types, array $context = []);
/**
* Checks whether the value of a URI variable can be transformed to its type by this transformer.
*
* @param mixed $value The URI variable value to transform
* @param array $types The types to which the URI variable value should be transformed
* @param array $context Options available to the transformer
* @param mixed $value The URI variable value to transform
* @param array<string> $types The types to which the URI variable value should be transformed
* @param array<string, mixed> $context Options available to the transformer
*/
public function supportsTransformation(mixed $value, array $types, array $context = []): bool;
}
7 changes: 4 additions & 3 deletions src/Metadata/UriVariablesConverterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ interface UriVariablesConverterInterface
/**
* Takes an array of strings representing URI variables (identifiers) and transform their values to the expected type.
*
* @param array $data URI variables to convert to PHP values
* @param string $class The class to which the URI variables belong to
* @param array<string, mixed> $data URI variables to convert to PHP values
* @param string $class The class to which the URI variables belong to
* @param array<string, mixed> $context
*
* @throws InvalidIdentifierException
* @throws InvalidUriVariableException
*
* @return array Array indexed by identifiers properties with their values denormalized
* @return array<string, mixed> Array indexed by identifiers properties with their values denormalized
*/
public function convert(array $data, string $class, array $context = []): array;
}
5 changes: 5 additions & 0 deletions src/Serializer/Filter/FilterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ interface FilterInterface extends BaseFilterInterface
{
/**
* Apply a filter to the serializer context.
*
* @param array<string, mixed> $attributes
* @param array<string, mixed> $context
*
* @param-out array<string, mixed> $context
*/
public function apply(Request $request, bool $normalization, array $attributes, array &$context): void;
}
2 changes: 2 additions & 0 deletions src/State/SerializerContextBuilderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ interface SerializerContextBuilderInterface
/**
* Creates a serialization context from a Request.
*
* @param array<string, mixed>|null $extractedAttributes
*
* @throws RuntimeException
*
* @return array<string, mixed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface PropertySchemaRestrictionMetadataInterface
* @param Constraint $constraint The validation constraint
* @param ApiProperty $propertyMetadata The property metadata
*
* @return array The array of restrictions
* @return array<string, mixed> The array of restrictions
*/
public function create(Constraint $constraint, ApiProperty $propertyMetadata): array;

Expand Down
2 changes: 2 additions & 0 deletions src/Validator/ValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ interface ValidatorInterface
/**
* Validates an item.
*
* @param array<string, mixed> $context
*
* @throws ValidationException
*/
public function validate(object $data, array $context = []): void;
Expand Down
Loading