Skip to content

Commit 8b1cb1a

Browse files
committed
Add LICENCE and fix php cs
1 parent 3e43b64 commit 8b1cb1a

File tree

84 files changed

+1228
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1228
-445
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build
33
vendor
44
composer.lock
55
composer.phar
6+
.php_cs.cache

.php_cs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
use Symfony\CS\Config\Config;
13+
use Symfony\CS\Finder\DefaultFinder;
14+
use Symfony\CS\Fixer\Contrib\HeaderCommentFixer;
15+
use Symfony\CS\FixerInterface;
16+
17+
$finder = DefaultFinder::create()
18+
->in(__DIR__)
19+
;
20+
21+
$header = <<<EOF
22+
This file is part of the OverblogGraphQLBundle package.
23+
24+
(c) Overblog <http://github.com/overblog/>
25+
26+
For the full copyright and license information, please view the LICENSE
27+
file that was distributed with this source code.
28+
EOF;
29+
30+
HeaderCommentFixer::setHeader($header);
31+
32+
return Config::create()
33+
->level(FixerInterface::SYMFONY_LEVEL)
34+
->fixers(['align_double_arrow', 'header_comment'])
35+
->finder($finder)
36+
->setUsingCache(true)
37+
;

Command/GraphDumpSchemaCommand.php

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Command;
413

514
use GraphQL\Type\Introspection;
@@ -29,8 +38,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
2938
$output = new SymfonyStyle($input, $output);
3039

3140
$request = [
32-
'query' => Introspection::getIntrospectionQuery(false),
33-
'variables' => [],
41+
'query' => Introspection::getIntrospectionQuery(false),
42+
'variables' => [],
3443
'operationName' => null,
3544
];
3645

@@ -50,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5059

5160
$file = $input->getOption('file');
5261
if (empty($file)) {
53-
$file = $container->getParameter('kernel.root_dir') . '/../var/schema.json';
62+
$file = $container->getParameter('kernel.root_dir').'/../var/schema.json';
5463
}
5564

5665
$schema = json_encode($result['data']);

Controller/GraphController.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Controller;
413

514
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

Definition/ArgsInterface.php

+10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Definition;
413

514
interface ArgsInterface
615
{
716
/**
817
* @param array $config
18+
*
919
* @return array
1020
*/
1121
public function toArgsDefinition(array $config);

Definition/Argument.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Definition;
413

514
class Argument implements \ArrayAccess, \Countable

Definition/Builder/ConfigBuilderInterface.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Definition\Builder;
413

514
interface ConfigBuilderInterface

Definition/Builder/SchemaBuilder.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Definition\Builder;
413

514
use GraphQL\Schema;
@@ -13,10 +22,10 @@ class SchemaBuilder
1322
*/
1423
private $typeResolver;
1524

16-
/** @var Array */
25+
/** @var array */
1726
private $typesMapping;
1827

19-
/** @var boolean */
28+
/** @var bool */
2029
private $enableValidation;
2130

2231
public function __construct(ResolverInterface $typeResolver, array $typesMapping, $enableValidation = false)
@@ -30,6 +39,7 @@ public function __construct(ResolverInterface $typeResolver, array $typesMapping
3039
* @param null|string $queryAlias
3140
* @param null|string $mutationAlias
3241
* @param null|string $subscriptionAlias
42+
*
3343
* @return Schema
3444
*/
3545
public function create($queryAlias = null, $mutationAlias = null, $subscriptionAlias = null)

Definition/Builder/TypeBuilder.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Definition\Builder;
413

514
use GraphQL\Type\Definition\Type;
@@ -17,6 +26,7 @@ public function __construct(ResolverInterface $configResolver)
1726
/**
1827
* @param $type
1928
* @param array $config
29+
*
2030
* @return Type
2131
*/
2232
public function create($type, array $config)
@@ -28,7 +38,7 @@ public function create($type, array $config)
2838

2939
private function getBaseClassName($type)
3040
{
31-
switch($type) {
41+
switch ($type) {
3242
case 'relay-connection':
3343
$class = 'Overblog\\GraphQLBundle\\Relay\\Connection\\ConnectionType';
3444
break;

Definition/FieldInterface.php

+10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Definition;
413

514
interface FieldInterface
615
{
716
/**
817
* @param array $config
18+
*
919
* @return array
1020
*/
1121
public function toFieldDefinition(array $config);

Definition/MergeFieldTrait.php

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\Definition;
413

514
trait MergeFieldTrait
615
{
716
protected function getFieldsWithDefaults($fields, array $defaultFields, $forceArray = true)
817
{
9-
$callback = function() use ($fields, $defaultFields) {
18+
$callback = function () use ($fields, $defaultFields) {
1019
if (empty($fields)) {
1120
return $defaultFields;
1221
}

DependencyInjection/Compiler/ArgPass.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
413

514
class ArgPass extends TaggedServiceMappingPass

DependencyInjection/Compiler/FieldPass.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
413

514
class FieldPass extends TaggedServiceMappingPass

DependencyInjection/Compiler/MutationPass.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
413

514
class MutationPass extends ResolverPass

DependencyInjection/Compiler/ResolverPass.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
413

514
class ResolverPass extends TaggedServiceMappingPass

DependencyInjection/Compiler/TaggedServiceMappingPass.php

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
413

514
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
@@ -16,9 +25,10 @@ private function getTaggedServiceMapping(ContainerBuilder $container, $tagName)
1625
foreach ($taggedServices as $id => $tags) {
1726
foreach ($tags as $tag) {
1827
$this->checkRequirements($id, $tag);
19-
$serviceMapping[$tag['alias']] = array_merge($tag, ['id' => $id]);
28+
$serviceMapping[$tag['alias']] = array_merge($tag, ['id' => $id]);
2029
}
2130
}
31+
2232
return $serviceMapping;
2333
}
2434

DependencyInjection/Compiler/TypePass.php

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the OverblogGraphQLBundle package.
5+
*
6+
* (c) Overblog <http://github.com/overblog/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
413

514
use Symfony\Component\DependencyInjection\ContainerBuilder;

0 commit comments

Comments
 (0)