Skip to content

Commit d24612e

Browse files
authored
Merge pull request #43 from moufmouf/symfony5_compat
Compatibility with Symfony 5
2 parents 6abe8c7 + bb34582 commit d24612e

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

DependencyInjection/GraphqliteCompilerPass.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection;
55

6+
use Symfony\Component\Cache\Adapter\ApcuAdapter;
7+
use Symfony\Component\Cache\Adapter\PhpFilesAdapter;
8+
use Symfony\Component\Cache\Psr16Cache;
69
use function class_exists;
710
use Doctrine\Common\Annotations\AnnotationException;
811
use Doctrine\Common\Annotations\AnnotationReader as DoctrineAnnotationReader;
@@ -381,9 +384,9 @@ private function getPsr16Cache(): CacheInterface
381384
{
382385
if ($this->cache === null) {
383386
if (function_exists('apcu_fetch')) {
384-
$this->cache = new SymfonyApcuCache('graphqlite_bundle');
387+
$this->cache = new Psr16Cache(new ApcuAdapter('graphqlite_bundle'));
385388
} else {
386-
$this->cache = new SymfonyPhpFilesCache('graphqlite_bundle');
389+
$this->cache = new Psr16Cache(new PhpFilesAdapter('graphqlite_bundle'));
387390
}
388391
}
389392
return $this->cache;

Resources/config/container/graphqlite.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@
7575
<tag name="graphql.type_mapper"/>
7676
</service>
7777

78-
<service id="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController" public="true" />
78+
<service id="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController" public="true">
79+
<tag name="routing.route_loader"/>
80+
</service>
7981

8082
<service id="TheCodingMachine\Graphqlite\Bundle\Mappers\RequestParameterMiddleware">
8183
<tag name="graphql.parameter_middleware"/>

Resources/config/routes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
xsi:schemaLocation="http://symfony.com/schema/routing
55
http://symfony.com/schema/routing/routing-1.0.xsd">
66

7-
<import resource="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController:loadRoutes" type="service"/>
7+
<import resource="TheCodingMachine\Graphqlite\Bundle\Controller\GraphqliteController::loadRoutes" type="service"/>
88
</routes>

Tests/Fixtures/Entities/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getName(): string
3030
}
3131

3232
/**
33-
* @return string
33+
* @return float
3434
*/
3535
public function getPrice(): float
3636
{

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"php" : ">=7.2",
2020
"thecodingmachine/graphqlite" : "~4.0.0",
2121
"thecodingmachine/graphqlite-symfony-validator-bridge" : "~4.0.0",
22-
"symfony/framework-bundle": "^4.1.9",
23-
"symfony/validator": "^4.1.9",
24-
"symfony/translation": "^4.1.9",
22+
"symfony/framework-bundle": "^4.1.9 | ^5",
23+
"symfony/validator": "^4.1.9 | ^5",
24+
"symfony/translation": "^4.1.9 | ^5",
2525
"doctrine/annotations": "^1.6",
2626
"doctrine/cache": "^1.8",
2727
"symfony/psr-http-message-bridge": "^1",
@@ -31,8 +31,8 @@
3131
"thecodingmachine/cache-utils": "^1"
3232
},
3333
"require-dev": {
34-
"symfony/security-bundle": "^4.1.9",
35-
"symfony/yaml": "^4.1.9",
34+
"symfony/security-bundle": "^4.1.9 | ^5",
35+
"symfony/yaml": "^4.1.9 | ^5",
3636
"phpunit/phpunit": "^7.5.1",
3737
"phpstan/phpstan": "^0.10.6",
3838
"beberlei/porpaginas": "^1.2",

0 commit comments

Comments
 (0)