Skip to content

Commit c1c6341

Browse files
author
Jeremiah VALERIE
committed
Migrate to PHP 7.1
1 parent 4910afa commit c1c6341

File tree

250 files changed

+1187
-703
lines changed

Some content is hidden

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

250 files changed

+1187
-703
lines changed

.php_cs.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ return PhpCsFixer\Config::create()
1010
->setRules(
1111
[
1212
'@Symfony' => true,
13+
'@PHP71Migration' => true,
14+
'@PHP71Migration:risky' => true,
1315
'single_blank_line_before_namespace' => true,
1416
'ordered_imports' => true,
1517
'concat_space' => ['spacing' => 'none'],
@@ -19,7 +21,6 @@ return PhpCsFixer\Config::create()
1921
'general_phpdoc_annotation_remove' => ['author', 'category', 'copyright', 'created', 'license', 'package', 'since', 'subpackage', 'version'],
2022
'native_function_invocation' => true,
2123
'fully_qualified_strict_types' => true,
22-
'native_constant_invocation' => true,
2324
]
2425
)
2526
->setFinder($finder)

benchmarks/Benchmark.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Benchmarks;
46

57
/**
@@ -8,11 +10,11 @@
810
*/
911
abstract class Benchmark
1012
{
11-
public function setUp()
13+
public function setUp(): void
1214
{
1315
}
1416

15-
public function tearDown()
17+
public function tearDown(): void
1618
{
1719
}
1820
}

benchmarks/Config/ParserGraphQLParserBench.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Benchmarks\Config;
46

57
use Overblog\GraphQLBundle\Benchmarks\Benchmark;
@@ -15,12 +17,12 @@ final class ParserGraphQLParserBench extends Benchmark
1517
/** @var ContainerBuilder */
1618
private $container;
1719

18-
public function setUp()
20+
public function setUp(): void
1921
{
2022
$this->container = new ContainerBuilder();
2123
}
2224

23-
public function benchParse()
25+
public function benchParse(): void
2426
{
2527
GraphQLParser::parse(new \SplFileInfo(__DIR__.'/../fixtures/schema.graphql'), $this->container);
2628
}

benchmarks/Mock/ContainerBuilder.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Benchmarks\Mock;
46

57
use Symfony\Component\Config\Resource\ResourceInterface;

benchmarks/Request/ParserBench.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Benchmarks\Request;
46

57
use Overblog\GraphQLBundle\Benchmarks\Benchmark;
@@ -15,7 +17,7 @@ final class ParserBench extends Benchmark
1517
/** @var Parser */
1618
private $parser;
1719

18-
public function setUp()
20+
public function setUp(): void
1921
{
2022
$this->parser = new Parser();
2123
}
@@ -25,7 +27,7 @@ public function setUp()
2527
*
2628
* @param array $args
2729
*/
28-
public function benchParse(array $args)
30+
public function benchParse(array $args): void
2931
{
3032
$this->parser->parse(new Request(...$args));
3133
}

src/CacheWarmer/CompileCacheWarmer.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\CacheWarmer;
46

57
use Overblog\GraphQLBundle\Generator\TypeGenerator;
@@ -26,7 +28,7 @@ public function isOptional()
2628
/**
2729
* {@inheritdoc}
2830
*/
29-
public function warmUp($cacheDir)
31+
public function warmUp($cacheDir): void
3032
{
3133
// use warm up cache dir if type generator cache dir not already explicitly declare
3234
$baseCacheDir = $this->typeGenerator->getBaseCacheDir();

src/Command/CompileCommand.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Command;
46

57
use Overblog\GraphQLBundle\Generator\TypeGenerator;
@@ -19,15 +21,15 @@ public function __construct(TypeGenerator $typeGenerator)
1921
$this->typeGenerator = $typeGenerator;
2022
}
2123

22-
protected function configure()
24+
protected function configure(): void
2325
{
2426
$this
2527
->setName('graphql:compile')
2628
->setDescription('Generate types manually.')
2729
;
2830
}
2931

30-
protected function execute(InputInterface $input, OutputInterface $output)
32+
protected function execute(InputInterface $input, OutputInterface $output): void
3133
{
3234
$output->writeln('<info>Types compilation starts</info>');
3335
$classes = $this->typeGenerator->compile(TypeGenerator::MODE_WRITE | TypeGenerator::MODE_OVERRIDE);

src/Command/DebugCommand.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Command;
46

57
use Overblog\GraphQLBundle\Resolver\FluentResolverInterface;
@@ -42,7 +44,7 @@ public function __construct(
4244
$this->resolverResolver = $resolverResolver;
4345
}
4446

45-
protected function configure()
47+
protected function configure(): void
4648
{
4749
$this
4850
->setName('graphql:debug')
@@ -56,7 +58,7 @@ protected function configure()
5658
->setDescription('Display current GraphQL services (types, resolvers and mutations)');
5759
}
5860

59-
protected function execute(InputInterface $input, OutputInterface $output)
61+
protected function execute(InputInterface $input, OutputInterface $output): void
6062
{
6163
$categoriesOption = $input->getOption('category');
6264
$categoriesOption = \is_array($categoriesOption) ? $categoriesOption : [$categoriesOption];
@@ -84,7 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8486
* @param array $tableHeaders
8587
* @param SymfonyStyle $io
8688
*/
87-
private function renderTable(FluentResolverInterface $resolver, array $tableHeaders, SymfonyStyle $io)
89+
private function renderTable(FluentResolverInterface $resolver, array $tableHeaders, SymfonyStyle $io): void
8890
{
8991
$tableRows = [];
9092
$solutionIDs = \array_keys($resolver->getSolutions());

src/Command/GraphQLDumpSchemaCommand.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Command;
46

57
use GraphQL\Type\Introspection;
@@ -23,7 +25,7 @@ public function __construct($baseExportPath)
2325
$this->baseExportPath = $baseExportPath;
2426
}
2527

26-
protected function configure()
28+
protected function configure(): void
2729
{
2830
$this
2931
->setName('graphql:dump-schema')
@@ -69,7 +71,7 @@ protected function configure()
6971
;
7072
}
7173

72-
protected function execute(InputInterface $input, OutputInterface $output)
74+
protected function execute(InputInterface $input, OutputInterface $output): void
7375
{
7476
$io = new SymfonyStyle($input, $output);
7577
$file = $this->createFile($input);

src/Command/RequestExecutorLazyLoaderTrait.php

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

3+
declare(strict_types=1);
4+
35
namespace Overblog\GraphQLBundle\Command;
46

57
use Overblog\GraphQLBundle\Request\Executor as RequestExecutor;
@@ -12,15 +14,15 @@ trait RequestExecutorLazyLoaderTrait
1214
/** @var array */
1315
private $requestExecutorFactory;
1416

15-
public function setRequestExecutorFactory(array $requestExecutorFactory)
17+
public function setRequestExecutorFactory(array $requestExecutorFactory): void
1618
{
1719
$this->requestExecutorFactory = $requestExecutorFactory;
1820
}
1921

2022
/**
2123
* @return RequestExecutor
2224
*/
23-
protected function getRequestExecutor()
25+
protected function getRequestExecutor(): RequestExecutor
2426
{
2527
if (null === $this->requestExecutor && null !== $this->requestExecutorFactory) {
2628
$this->requestExecutor = \call_user_func_array(...$this->requestExecutorFactory);

0 commit comments

Comments
 (0)