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

Support for GraphQLite v5 #11

Merged
merged 1 commit into from
Dec 16, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<?php


namespace TheCodingMachine\Tdbm\Graphql\Bundle\DependencyInjection;
namespace TheCodingMachine\Tdbm\GraphQL\Bundle\DependencyInjection;


use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

class TheCodingMachineTdbmGraphqlExtension extends Extension
class TheCodingMachineTdbmGraphQLExtension extends Extension
{

/**
* Loads a specific configuration.
*
* @param array<mixed, mixed> $configs
*
* @throws \InvalidArgumentException When provided tag is not defined in this extension
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container) : void
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/container'));
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config/container'));
$loader->load('tdbmgraphql.xml');
}
}
2 changes: 1 addition & 1 deletion Tests/Fixtures/ExposeConfiguration.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php


namespace TheCodingMachine\Tdbm\Graphql\Bundle\Tests\Fixtures;
namespace TheCodingMachine\Tdbm\GraphQL\Bundle\Tests\Fixtures;


use TheCodingMachine\TDBM\Configuration;
Expand Down
2 changes: 1 addition & 1 deletion Tests/Fixtures/config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:

# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
TheCodingMachine\Tdbm\Graphql\Bundle\Tests\Fixtures\:
TheCodingMachine\Tdbm\GraphQL\Bundle\Tests\Fixtures\:
resource: '../*'
exclude: '../{Entities}'
public: true
Expand Down
8 changes: 4 additions & 4 deletions Tests/FunctionalTest.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace TheCodingMachine\Tdbm\Graphql\Bundle\Tests;
namespace TheCodingMachine\Tdbm\GraphQL\Bundle\Tests;

use Laminas\Code\Generator\FileGenerator;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use TheCodingMachine\Tdbm\Graphql\Bundle\Tests\Fixtures\ExposeConfiguration;
use TheCodingMachine\Tdbm\GraphQL\Bundle\Tests\Fixtures\ExposeConfiguration;
use TheCodingMachine\TDBM\Utils\BeanDescriptor;
use Zend\Code\Generator\FileGenerator;
use TheCodingMachine\GraphQLite\Annotations\Field;

class FunctionalTest extends KernelTestCase
{
protected static function createKernel(array $options = [])
{
return new TdbmGraphqlTestingKernel('test', true);
return new TdbmGraphQLTestingKernel('test', true);
}

public function testServiceWiring()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<?php


namespace TheCodingMachine\Tdbm\Graphql\Bundle\Tests;
namespace TheCodingMachine\Tdbm\GraphQL\Bundle\Tests;


use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Routing\RouteCollectionBuilder;
use TheCodingMachine\Graphqlite\Bundle\GraphqliteBundle;
use TheCodingMachine\GraphQLite\Bundle\GraphQLiteBundle;
use TheCodingMachine\TDBM\Bundle\TdbmBundle;
use TheCodingMachine\Tdbm\Graphql\Bundle\TheCodingMachineTdbmGraphqlBundle;
use TheCodingMachine\Tdbm\GraphQL\Bundle\TheCodingMachineTdbmGraphQLBundle;

class TdbmGraphqlTestingKernel extends Kernel
class TdbmGraphQLTestingKernel extends Kernel
{
use MicroKernelTrait;

Expand All @@ -28,11 +29,11 @@ public function __construct()
public function registerBundles()
{
return [
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new FrameworkBundle(),
new DoctrineBundle(),
new TdbmBundle(),
new GraphqliteBundle(),
new TheCodingMachineTdbmGraphqlBundle(),
new GraphQLiteBundle(),
new TheCodingMachineTdbmGraphQLBundle(),
];
}

Expand All @@ -57,8 +58,8 @@ public function configureContainer(ContainerBuilder $c, LoaderInterface $loader)

$container->loadFromExtension('graphqlite', array(
'namespace' => [
'controllers' => ['TheCodingMachine\\Graphqlite\\Bundle\\Tests\\Fixtures\\Controller\\'],
'types' => ['TheCodingMachine\\Graphqlite\\Bundle\\Tests\\Fixtures\\Types\\', 'TheCodingMachine\\Graphqlite\\Bundle\\Tests\\Fixtures\\Entities\\']
'controllers' => ['TheCodingMachine\\GraphQLite\\Bundle\\Tests\\Fixtures\\Controller\\'],
'types' => ['TheCodingMachine\\GraphQLite\\Bundle\\Tests\\Fixtures\\Types\\', 'TheCodingMachine\\GraphQLite\\Bundle\\Tests\\Fixtures\\Entities\\']
]
));
});
Expand Down
10 changes: 10 additions & 0 deletions TheCodingMachineTdbmGraphQLBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php


namespace TheCodingMachine\Tdbm\GraphQL\Bundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class TheCodingMachineTdbmGraphQLBundle extends Bundle
{
}
10 changes: 0 additions & 10 deletions TheCodingMachineTdbmGraphqlBundle.php

This file was deleted.

12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@
],
"require" : {
"php" : ">=7.2",
"thecodingmachine/graphqlite-bundle": "^4",
"thecodingmachine/graphqlite-bundle": "^5",
"thecodingmachine/tdbm-bundle": "^5.2",
"thecodingmachine/tdbm-graphql": "~4.0",
"thecodingmachine/tdbm-graphql": "^5.0",
"symfony/framework-bundle": "^4.1.9 | ^5"
},
"require-dev": {
"symfony/security-bundle": "^4.1.9 | ^5",
"symfony/yaml": "^4.1.9 | ^5",
"phpunit/phpunit": "^8.0.4",
"phpstan/phpstan-shim": "^0.11.4",
"phpstan/phpstan": "^1",
"php-coveralls/php-coveralls": "^2.1"
},
"scripts": {
"phpstan": "phpstan analyse TheCodingMachineTdbmGraphqlBundle.php DependencyInjection/ Resources/ -c phpstan.neon --level=7 --no-progress"
"phpstan": "phpstan analyse TheCodingMachineTdbmGraphQLBundle.php DependencyInjection/ Resources/ -c phpstan.neon --level=7 --no-progress"
},
"autoload" : {
"psr-4" : {
"TheCodingMachine\\Tdbm\\Graphql\\Bundle\\" : ""
"TheCodingMachine\\Tdbm\\GraphQL\\Bundle\\" : ""
}
},
"extra": {
"branch-alias": {
"dev-master": "4.1.x-dev"
"dev-master": "5.0.x-dev"
}
},
"minimum-stability": "dev",
Expand Down