Skip to content

Commit 38a7abc

Browse files
committed
Renaming bundle to graphqlite
1 parent 8cae67e commit 38a7abc

25 files changed

+219
-219
lines changed

DependencyInjection/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33

4-
namespace TheCodingMachine\Graphql\Controllers\Bundle\DependencyInjection;
4+
namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection;
55

66
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
77
use Symfony\Component\Config\Definition\ConfigurationInterface;
@@ -11,7 +11,7 @@ class Configuration implements ConfigurationInterface
1111
public function getConfigTreeBuilder()
1212
{
1313
$treeBuilder = new TreeBuilder();
14-
$rootNode = $treeBuilder->root('graphql_controllers');
14+
$rootNode = $treeBuilder->root('graphqlite');
1515

1616
$rootNode
1717
->children()

DependencyInjection/GraphqlControllersCompilerPass.php renamed to DependencyInjection/GraphqliteCompilerPass.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33

4-
namespace TheCodingMachine\Graphql\Controllers\Bundle\DependencyInjection;
4+
namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection;
55

66
use function class_exists;
77
use Doctrine\Common\Annotations\AnnotationException;
@@ -20,26 +20,26 @@
2020
use Symfony\Component\DependencyInjection\ContainerBuilder;
2121
use Symfony\Component\DependencyInjection\Definition;
2222
use Symfony\Component\DependencyInjection\Reference;
23-
use TheCodingMachine\GraphQL\Controllers\AnnotationReader;
24-
use TheCodingMachine\GraphQL\Controllers\Annotations\Mutation;
25-
use TheCodingMachine\GraphQL\Controllers\Annotations\Query;
26-
use TheCodingMachine\Graphql\Controllers\Bundle\Mappers\ContainerFetcherTypeMapper;
27-
use TheCodingMachine\Graphql\Controllers\Bundle\QueryProviders\ControllerQueryProvider;
28-
use TheCodingMachine\GraphQL\Controllers\FieldsBuilderFactory;
29-
use TheCodingMachine\GraphQL\Controllers\InputTypeGenerator;
30-
use TheCodingMachine\GraphQL\Controllers\InputTypeUtils;
31-
use TheCodingMachine\GraphQL\Controllers\Mappers\GlobTypeMapper;
32-
use TheCodingMachine\GraphQL\Controllers\Mappers\RecursiveTypeMapperInterface;
33-
use TheCodingMachine\GraphQL\Controllers\Mappers\StaticTypeMapper;
34-
use TheCodingMachine\GraphQL\Controllers\NamingStrategy;
35-
use TheCodingMachine\GraphQL\Controllers\TypeGenerator;
36-
use TheCodingMachine\GraphQL\Controllers\Types\MutableObjectType;
37-
use TheCodingMachine\GraphQL\Controllers\Types\ResolvableInputObjectType;
23+
use TheCodingMachine\GraphQLite\AnnotationReader;
24+
use TheCodingMachine\GraphQLite\Annotations\Mutation;
25+
use TheCodingMachine\GraphQLite\Annotations\Query;
26+
use TheCodingMachine\Graphqlite\Bundle\Mappers\ContainerFetcherTypeMapper;
27+
use TheCodingMachine\Graphqlite\Bundle\QueryProviders\ControllerQueryProvider;
28+
use TheCodingMachine\GraphQLite\FieldsBuilderFactory;
29+
use TheCodingMachine\GraphQLite\InputTypeGenerator;
30+
use TheCodingMachine\GraphQLite\InputTypeUtils;
31+
use TheCodingMachine\GraphQLite\Mappers\GlobTypeMapper;
32+
use TheCodingMachine\GraphQLite\Mappers\RecursiveTypeMapperInterface;
33+
use TheCodingMachine\GraphQLite\Mappers\StaticTypeMapper;
34+
use TheCodingMachine\GraphQLite\NamingStrategy;
35+
use TheCodingMachine\GraphQLite\TypeGenerator;
36+
use TheCodingMachine\GraphQLite\Types\MutableObjectType;
37+
use TheCodingMachine\GraphQLite\Types\ResolvableInputObjectType;
3838

3939
/**
4040
* Detects controllers and types automatically and tag them.
4141
*/
42-
class GraphqlControllersCompilerPass implements CompilerPassInterface
42+
class GraphqliteCompilerPass implements CompilerPassInterface
4343
{
4444
/**
4545
* @var AnnotationReader
@@ -71,8 +71,8 @@ public function process(ContainerBuilder $container)
7171
//$inputTypeUtils = new InputTypeUtils($reader, $namingStrategy);
7272

7373
// Let's scan the whole container and tag the services that belong to the namespace we want to inspect.
74-
$controllersNamespaces = $container->getParameter('graphql_controllers.namespace.controllers');
75-
$typesNamespaces = $container->getParameter('graphql_controllers.namespace.types');
74+
$controllersNamespaces = $container->getParameter('graphqlite.namespace.controllers');
75+
$typesNamespaces = $container->getParameter('graphqlite.namespace.types');
7676

7777
foreach ($container->getDefinitions() as $id => $definition) {
7878
if ($definition->isAbstract() || $definition->getClass() === null) {

DependencyInjection/GraphqlControllersExtension.php renamed to DependencyInjection/GraphqliteExtension.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33

4-
namespace TheCodingMachine\Graphql\Controllers\Bundle\DependencyInjection;
4+
namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection;
55

66

77
use GraphQL\Error\Debug;
@@ -15,10 +15,10 @@
1515
use Symfony\Component\DependencyInjection\Definition;
1616
use Symfony\Component\DependencyInjection\Extension\Extension;
1717
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
18-
use TheCodingMachine\GraphQL\Controllers\GraphQLException;
18+
use TheCodingMachine\GraphQLite\GraphQLException;
1919
use function var_dump;
2020

21-
class GraphqlControllersExtension extends Extension
21+
class GraphqliteExtension extends Extension
2222
{
2323

2424
/**
@@ -37,10 +37,10 @@ public function load(array $configs, ContainerBuilder $container)
3737
$namespaceController = array_map(function($namespace) { return rtrim($namespace, '\\') . '\\'; }, $configs[0]['namespace']['controllers']);
3838
$namespaceType = array_map(function($namespace) { return rtrim($namespace, '\\') . '\\'; }, $configs[0]['namespace']['types']);
3939

40-
$container->setParameter('graphql_controllers.namespace.controllers', $namespaceController);
41-
$container->setParameter('graphql_controllers.namespace.types', $namespaceType);
40+
$container->setParameter('graphqlite.namespace.controllers', $namespaceController);
41+
$container->setParameter('graphqlite.namespace.types', $namespaceType);
4242

43-
$loader->load('graphql-controllers.xml');
43+
$loader->load('graphqlite.xml');
4444

4545
$definition = $container->getDefinition(ServerConfig::class);
4646
if (isset($config['debug'])) {
@@ -78,9 +78,9 @@ private function getNamespaceDir(string $namespace): string
7878

7979
$possibleFileNames = $classNameMapper->getPossibleFileNames($namespace.'Xxx');
8080
if (count($possibleFileNames) > 1) {
81-
throw new \RuntimeException(sprintf('According to your composer.json, classes belonging to the "%s" namespace can be located in several directories: %s. This is an issue for the GraphQL-Controllers lib. Please make sure that a namespace can only be resolved to one PHP file.', $namespace, implode(", ", $possibleFileNames)));
81+
throw new \RuntimeException(sprintf('According to your composer.json, classes belonging to the "%s" namespace can be located in several directories: %s. This is an issue for the GraphQLite lib. Please make sure that a namespace can only be resolved to one PHP file.', $namespace, implode(", ", $possibleFileNames)));
8282
} elseif (empty($possibleFileNames)) {
83-
throw new \RuntimeException(sprintf('Files in namespace "%s" cannot be autoloaded by Composer. Please set up a PSR-4 autoloader in Composer or change the namespace configured in "graphql_controllers.namespace.controllers" and "graphql_controllers.namespace.types"', $namespace));
83+
throw new \RuntimeException(sprintf('Files in namespace "%s" cannot be autoloaded by Composer. Please set up a PSR-4 autoloader in Composer or change the namespace configured in "graphqlite.namespace.controllers" and "graphqlite.namespace.types"', $namespace));
8484
}
8585

8686
return substr($possibleFileNames[0], 0, -8);

DependencyInjection/OverblogGraphiQLEndpointWiringPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3-
namespace TheCodingMachine\Graphql\Controllers\Bundle\DependencyInjection;
3+
namespace TheCodingMachine\Graphqlite\Bundle\DependencyInjection;
44

55
use Overblog\GraphiQLBundle\Config\GraphiQLControllerEndpoint;
66
use Overblog\GraphiQLBundle\Config\GraphqlEndpoint\RootResolver;
77
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
88
use Symfony\Component\DependencyInjection\ContainerBuilder;
99
use Symfony\Component\DependencyInjection\Definition;
1010
use Symfony\Component\DependencyInjection\Reference;
11-
use TheCodingMachine\Graphql\Controllers\Bundle\GraphiQL\EndpointResolver;
11+
use TheCodingMachine\Graphqlite\Bundle\GraphiQL\EndpointResolver;
1212

1313
final class OverblogGraphiQLEndpointWiringPass implements CompilerPassInterface
1414
{

EventListeners/RequestHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33

4-
namespace TheCodingMachine\Graphql\Controllers\Bundle\EventListeners;
4+
namespace TheCodingMachine\Graphqlite\Bundle\EventListeners;
55

66

77
use GraphQL\Error\Debug;

GraphiQL/EndpointResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace TheCodingMachine\Graphql\Controllers\Bundle\GraphiQL;
3+
namespace TheCodingMachine\Graphqlite\Bundle\GraphiQL;
44

55
use Overblog\GraphiQLBundle\Config\GraphiQLControllerEndpoint;
66
use Symfony\Component\HttpFoundation\RequestStack;

GraphqlControllersBundle.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

GraphqliteBundle.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
4+
namespace TheCodingMachine\Graphqlite\Bundle;
5+
6+
use TheCodingMachine\Graphqlite\Bundle\DependencyInjection\OverblogGraphiQLEndpointWiringPass;
7+
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
8+
use Symfony\Component\DependencyInjection\ContainerBuilder;
9+
use Symfony\Component\HttpKernel\Bundle\Bundle;
10+
use TheCodingMachine\Graphqlite\Bundle\DependencyInjection\GraphqliteCompilerPass;
11+
12+
class GraphqliteBundle extends Bundle
13+
{
14+
public function build(ContainerBuilder $container)
15+
{
16+
parent::build($container);
17+
18+
$container->addCompilerPass(new GraphqliteCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION);
19+
$container->addCompilerPass(new OverblogGraphiQLEndpointWiringPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -1);
20+
}
21+
}

Mappers/ContainerFetcherTypeMapper.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33

4-
namespace TheCodingMachine\Graphql\Controllers\Bundle\Mappers;
4+
namespace TheCodingMachine\Graphqlite\Bundle\Mappers;
55

66
use GraphQL\Type\Definition\InputObjectType;
77
use GraphQL\Type\Definition\NamedType;
@@ -10,11 +10,11 @@
1010
use GraphQL\Type\Definition\InputType;
1111
use GraphQL\Type\Definition\OutputType;
1212
use Psr\Container\ContainerInterface;
13-
use TheCodingMachine\GraphQL\Controllers\Mappers\CannotMapTypeException;
14-
use TheCodingMachine\GraphQL\Controllers\Mappers\CannotMapTypeExceptionInterface;
15-
use TheCodingMachine\GraphQL\Controllers\Mappers\RecursiveTypeMapperInterface;
16-
use TheCodingMachine\GraphQL\Controllers\Mappers\TypeMapperInterface;
17-
use TheCodingMachine\GraphQL\Controllers\Types\MutableObjectType;
13+
use TheCodingMachine\GraphQLite\Mappers\CannotMapTypeException;
14+
use TheCodingMachine\GraphQLite\Mappers\CannotMapTypeExceptionInterface;
15+
use TheCodingMachine\GraphQLite\Mappers\RecursiveTypeMapperInterface;
16+
use TheCodingMachine\GraphQLite\Mappers\TypeMapperInterface;
17+
use TheCodingMachine\GraphQLite\Types\MutableObjectType;
1818

1919
/**
2020
* A type mapper that fetches types from the container that is directly injected in the type mapper.

QueryProviders/ControllerQueryProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

33

4-
namespace TheCodingMachine\Graphql\Controllers\Bundle\QueryProviders;
4+
namespace TheCodingMachine\Graphqlite\Bundle\QueryProviders;
55

66

7-
use TheCodingMachine\GraphQL\Controllers\FieldsBuilder;
8-
use TheCodingMachine\GraphQL\Controllers\QueryField;
9-
use TheCodingMachine\GraphQL\Controllers\QueryProviderInterface;
7+
use TheCodingMachine\GraphQLite\FieldsBuilder;
8+
use TheCodingMachine\GraphQLite\QueryField;
9+
use TheCodingMachine\GraphQLite\QueryProviderInterface;
1010

1111
class ControllerQueryProvider implements QueryProviderInterface
1212
{

0 commit comments

Comments
 (0)