Skip to content

Commit 834064f

Browse files
fix(metadata): filter interface context php doc (#7560)
1 parent 502c0e2 commit 834064f

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

phpstan.neon.dist

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,6 @@ parameters:
103103
# Allow extra assertions in tests: https://github.com/phpstan/phpstan-strict-rules/issues/130
104104
- '#^Call to (static )?method PHPUnit\\Framework\\Assert::.* will always evaluate to true\.$#'
105105

106-
# Unsealed array shapes not supported
107-
-
108-
message: '#^Parameter &\$context by\-ref type of method ApiPlatform\\Doctrine\\Odm\\Extension\\ParameterExtension\:\:applyFilter\(\) expects array\<string, mixed\>, array(.*) given\.$#'
109-
identifier: parameterByRef.type
110-
count: 5
111-
path: src/Doctrine/Odm/Extension/ParameterExtension.php
112-
113106
# Level 6
114107
-
115108
identifier: missingType.iterableValue

src/Doctrine/Odm/Filter/AbstractFilter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public function apply(Builder $aggregationBuilder, string $resourceClass, ?Opera
5959

6060
/**
6161
* Passes a property through the filter.
62+
*
63+
* @param array<string, mixed> $context
64+
*
65+
* @param-out array<string, mixed> $context
6266
*/
6367
abstract protected function filterProperty(string $property, mixed $value, Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void;
6468

src/Doctrine/Odm/Filter/FilterInterface.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ interface FilterInterface extends BaseFilterInterface
2828
/**
2929
* Applies the filter.
3030
*
31-
* @param array|array{filters?: array<string, mixed>|array, parameter?: Parameter, mongodb_odm_sort_fields?: array, ...} $context
31+
* @phpstan-param array<string, mixed> $context
32+
*
33+
* @psalm-param array{filters?: array<string, mixed>, parameter?: Parameter, mongodb_odm_sort_fields?: array<mixed>, ...} $context
34+
*
35+
* @param-out array<string, mixed> $context
3236
*/
3337
public function apply(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void;
3438
}

src/Doctrine/Orm/Filter/FilterInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ interface FilterInterface extends BaseFilterInterface
2929
/**
3030
* Applies the filter.
3131
*
32-
* @param array{filters?: array<string, mixed>|array, parameter?: Parameter, ...} $context
32+
* @phpstan-param array<string, mixed> $context
33+
*
34+
* @psalm-param array{filters?: array<string, mixed>, parameter?: Parameter, ...} $context
3335
*/
3436
public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void;
3537
}

0 commit comments

Comments
 (0)