diff --git a/Command/GraphQLConfigureCommand.php b/Command/GraphQLConfigureCommand.php index ee6c492..adfbd18 100644 --- a/Command/GraphQLConfigureCommand.php +++ b/Command/GraphQLConfigureCommand.php @@ -8,11 +8,21 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\DependencyInjection\ContainerInterface; -class GraphQLConfigureCommand extends ContainerAwareCommand +class GraphQLConfigureCommand extends Command { const PROJECT_NAMESPACE = 'App'; + private ContainerInterface $container; + + public function __construct(ContainerInterface $container) + { + parent::__construct(); + $this->container = $container; + } + /** * {@inheritdoc} */ @@ -31,8 +41,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $isComposerCall = $input->getOption('composer'); - $container = $this->getContainer(); - $rootDir = $container->getParameter('kernel.root_dir'); + $rootDir = $this->container->getParameter('kernel.root_dir'); $configFile = $rootDir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'config/packages/graphql.yml'; $className = 'Schema'; diff --git a/Controller/GraphQLController.php b/Controller/GraphQLController.php index d8f7cf1..dd40d95 100644 --- a/Controller/GraphQLController.php +++ b/Controller/GraphQLController.php @@ -7,7 +7,7 @@ namespace Youshido\GraphQLBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; @@ -15,7 +15,7 @@ use Youshido\GraphQLBundle\Exception\UnableToInitializeSchemaServiceException; use Youshido\GraphQLBundle\Execution\Processor; -class GraphQLController extends Controller +class GraphQLController extends AbstractController { /** * @Route("/graphql") diff --git a/Controller/GraphQLExplorerController.php b/Controller/GraphQLExplorerController.php index 4b48736..4dc5e83 100644 --- a/Controller/GraphQLExplorerController.php +++ b/Controller/GraphQLExplorerController.php @@ -9,9 +9,9 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -class GraphQLExplorerController extends Controller +class GraphQLExplorerController extends AbstractController { /** * @Route("/graphql/explorer") diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index f8876d6..57c6917 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -18,8 +18,8 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('graphql'); + $treeBuilder = new TreeBuilder('graphql'); + $rootNode = $treeBuilder->getRootNode(); $rootNode ->children() diff --git a/composer.json b/composer.json index acf3f24..7440ebf 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "youshido/graphql-bundle", + "name": "ozznest/base-graphql-bundle", "description": "Symfony GraphQl Bundle", "license": "MIT", "authors": [