Skip to content

chore: remove 3.4 deprecation #7204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 4.1
Choose a base branch
from
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
12 changes: 3 additions & 9 deletions src/Doctrine/Odm/State/LinksHandlerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,8 @@ private function handleLinks(Builder $aggregationBuilder, array $identifiers, ar
/**
* @throws RuntimeException
*/
private function buildAggregation(string $toClass, array $links, array $identifiers, array $context, array $executeOptions, string $previousAggregationClass, Builder $previousAggregationBuilder, ?Operation $operation = null): Builder
private function buildAggregation(string $toClass, array $links, array $identifiers, array $context, array $executeOptions, string $previousAggregationClass, Builder $previousAggregationBuilder, Operation $operation): Builder
{
if (!$operation) {
trigger_deprecation('api-platform/core', '3.2', 'In API Platform 4 the last argument "operation" will be required and this trait will be internal. Use the "handleLinks" feature instead.');
}

if (\count($links) <= 0) {
return $previousAggregationBuilder;
}
Expand All @@ -88,10 +84,8 @@ private function buildAggregation(string $toClass, array $links, array $identifi

$manager = $this->managerRegistry->getManagerForClass($aggregationClass);
if (!$manager instanceof DocumentManager) {
if ($operation) {
$aggregationClass = $this->getLinkFromClass($link, $operation);
$manager = $this->managerRegistry->getManagerForClass($aggregationClass);
}
$aggregationClass = $this->getLinkFromClass($link, $operation);
$manager = $this->managerRegistry->getManagerForClass($aggregationClass);

if (!$manager instanceof DocumentManager) {
throw new RuntimeException(\sprintf('The manager for "%s" must be an instance of "%s".', $aggregationClass, DocumentManager::class));
Expand Down
6 changes: 0 additions & 6 deletions src/GraphQl/Action/EntrypointAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ public function __construct(
private readonly SchemaBuilderInterface $schemaBuilder,
private readonly ExecutorInterface $executor,
private readonly ?GraphiQlAction $graphiQlAction,
private readonly ?GraphQlPlaygroundAction $graphQlPlaygroundAction,
private readonly NormalizerInterface $normalizer,
private readonly ErrorHandlerInterface $errorHandler,
bool $debug = false,
private readonly bool $graphiqlEnabled = false,
private readonly bool $graphQlPlaygroundEnabled = false,
private readonly ?string $defaultIde = null,
?Negotiator $negotiator = null,
) {
Expand All @@ -64,10 +62,6 @@ public function __invoke(Request $request): Response
if ('graphiql' === $this->defaultIde && $this->graphiqlEnabled && $this->graphiQlAction) {
return ($this->graphiQlAction)($request);
}

if ('graphql-playground' === $this->defaultIde && $this->graphQlPlaygroundEnabled && $this->graphQlPlaygroundAction) {
return ($this->graphQlPlaygroundAction)($request);
}
}

[$query, $operationName, $variables] = $this->parseRequest($request);
Expand Down
45 changes: 0 additions & 45 deletions src/GraphQl/Action/GraphQlPlaygroundAction.php

This file was deleted.

4 changes: 1 addition & 3 deletions src/GraphQl/Tests/Action/EntrypointActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use ApiPlatform\GraphQl\Action\EntrypointAction;
use ApiPlatform\GraphQl\Action\GraphiQlAction;
use ApiPlatform\GraphQl\Action\GraphQlPlaygroundAction;
use ApiPlatform\GraphQl\Error\ErrorHandler;
use ApiPlatform\GraphQl\ExecutorInterface;
use ApiPlatform\GraphQl\Serializer\Exception\ErrorNormalizer;
Expand Down Expand Up @@ -270,8 +269,7 @@ private function getEntrypointAction(array $variables = ['graphqlVariable']): En
$routerProphecy->generate('api_graphql_entrypoint')->willReturn('/graphiql');

$graphiQlAction = new GraphiQlAction($twigProphecy->reveal(), $routerProphecy->reveal(), true);
$graphQlPlaygroundAction = new GraphQlPlaygroundAction($twigProphecy->reveal(), $routerProphecy->reveal(), true);

return new EntrypointAction($schemaBuilderProphecy->reveal(), $executorProphecy->reveal(), $graphiQlAction, $graphQlPlaygroundAction, $normalizer, $errorHandler, false, true, true, 'graphiql');
return new EntrypointAction($schemaBuilderProphecy->reveal(), $executorProphecy->reveal(), $graphiQlAction, $normalizer, $errorHandler, false, true, 'graphiql');
}
}
60 changes: 0 additions & 60 deletions src/GraphQl/Tests/Action/GraphQlPlaygroundActionTest.php

This file was deleted.

10 changes: 5 additions & 5 deletions src/Laravel/ApiPlatformProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
use Negotiation\Negotiator;
use phpDocumentor\Reflection\DocBlockFactory;
use PHPStan\PhpDocParser\Parser\PhpDocParser;
use Psr\Log\LoggerInterface;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor;
use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor;
use Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor;
use Symfony\Component\PropertyInfo\PropertyInfoExtractor;
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
Expand Down Expand Up @@ -196,13 +196,13 @@ public function register(): void
$this->mergeConfigFrom(__DIR__.'/config/api-platform.php', 'api-platform');

$this->app->singleton(PropertyInfoExtractorInterface::class, function () {
$phpDocExtractor = class_exists(DocBlockFactory::class) ? new PhpDocExtractor() : null;
$phpstanExtractor = class_exists(PhpDocParser::class) ? new PhpStanExtractor() : null;
$reflectionExtractor = new ReflectionExtractor();

return new PropertyInfoExtractor(
[$reflectionExtractor],
$phpDocExtractor ? [$phpDocExtractor, $reflectionExtractor] : [$reflectionExtractor],
$phpDocExtractor ? [$phpDocExtractor] : [],
$phpstanExtractor ? [$phpstanExtractor, $reflectionExtractor] : [$reflectionExtractor],
[],
[$reflectionExtractor],
[$reflectionExtractor]
);
Expand Down
14 changes: 7 additions & 7 deletions src/Laravel/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@
"illuminate/support": "^11.0 || ^12.0",
"illuminate/container": "^11.0 || ^12.0",
"symfony/web-link": "^6.4 || ^7.1",
"willdurand/negotiation": "^3.1",
"phpstan/phpdoc-parser": "^1.29 || ^2.0",
"phpdocumentor/reflection-docblock": "^5.1"
"willdurand/negotiation": "^3.1"
},
"require-dev": {
"api-platform/graphql": "^4.1",
"doctrine/dbal": "^4.0",
"larastan/larastan": "^2.0 || ^3.0",
"laravel/sanctum": "^4.0",
"orchestra/testbench": "^9.1",
"phpunit/phpunit": "11.5.x-dev",
"api-platform/graphql": "^4.1",
"laravel/sanctum": "^4.0"
"phpdocumentor/type-resolver": "^1.7",
"phpstan/phpdoc-parser": "^1.29 || ^2.0",
"phpunit/phpunit": "11.5.x-dev"
},
"autoload": {
"psr-4": {
Expand All @@ -74,7 +74,7 @@
},
"suggest": {
"api-platform/graphql": "Enable GraphQl support.",
"phpdocumentor/reflection-docblock": ""
"phpstan/phpdoc-parser": "To support extracting metadata from PHPDoc."
},
"extra": {
"laravel": {
Expand Down
Loading
Loading