Skip to content

Commit

Permalink
Merge bb34582 into 6abe8c7
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Nov 29, 2019
2 parents 6abe8c7 + bb34582 commit b49cd02
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
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

0 comments on commit b49cd02

Please sign in to comment.