Skip to content
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

Compatibility with Symfony 5 #43

Merged
merged 2 commits into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions DependencyInjection/GraphqliteCompilerPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection;

use Symfony\Component\Cache\Adapter\ApcuAdapter;
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
use Symfony\Component\Cache\Psr16Cache;
use function class_exists;
use Doctrine\Common\Annotations\AnnotationException;
use Doctrine\Common\Annotations\AnnotationReader as DoctrineAnnotationReader;
Expand Down Expand Up @@ -381,9 +384,9 @@ private function getPsr16Cache(): CacheInterface
{
if ($this->cache === null) {
if (function_exists('apcu_fetch')) {
$this->cache = new SymfonyApcuCache('graphqlite_bundle');
$this->cache = new Psr16Cache(new ApcuAdapter('graphqlite_bundle'));
} else {
$this->cache = new SymfonyPhpFilesCache('graphqlite_bundle');
$this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle'));
}
}
return $this->cache;
Expand Down
4 changes: 3 additions & 1 deletion Resources/config/container/graphqlite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
<tag name="graphql.type_mapper"/>
</service>

<service id="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController" public="true" />
<service id="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController" public="true">
<tag name="routing.route_loader"/>
</service>

<service id="TheCodingMachine\Graphqlite\Bundle\Mappers\RequestParameterMiddleware">
<tag name="graphql.parameter_middleware"/>
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/routes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
xsi:schemaLocation="http://symfony.com/schema/routing
http://symfony.com/schema/routing/routing-1.0.xsd">

<import resource="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController:loadRoutes" type="service"/>
<import resource="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController::loadRoutes" type="service"/>
</routes>
2 changes: 1 addition & 1 deletion Tests/Fixtures/Entities/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getName(): string
}

/**
* @return string
* @return float
*/
public function getPrice(): float
{
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"php" : ">=7.2",
"thecodingmachine/graphqlite" : "~4.0.0",
"thecodingmachine/graphqlite-symfony-validator-bridge" : "~4.0.0",
"symfony/framework-bundle": "^4.1.9",
"symfony/validator": "^4.1.9",
"symfony/translation": "^4.1.9",
"symfony/framework-bundle": "^4.1.9 | ^5",
"symfony/validator": "^4.1.9 | ^5",
"symfony/translation": "^4.1.9 | ^5",
"doctrine/annotations": "^1.6",
"doctrine/cache": "^1.8",
"symfony/psr-http-message-bridge": "^1",
Expand All @@ -31,8 +31,8 @@
"thecodingmachine/cache-utils": "^1"
},
"require-dev": {
"symfony/security-bundle": "^4.1.9",
"symfony/yaml": "^4.1.9",
"symfony/security-bundle": "^4.1.9 | ^5",
"symfony/yaml": "^4.1.9 | ^5",
"phpunit/phpunit": "^7.5.1",
"phpstan/phpstan": "^0.10.6",
"beberlei/porpaginas": "^1.2",
Expand Down