diff --git a/composer.json b/composer.json index 2eb5c2f..f20ab0c 100644 --- a/composer.json +++ b/composer.json @@ -55,8 +55,8 @@ } }, "scripts": { - "test": "bin/phpunit --color=always -v --debug", - "install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.15.3/php-cs-fixer.phar -O php-cs-fixer.phar", + "test": "bin/phpunit --color=always", + "install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.18.7/php-cs-fixer.phar -O php-cs-fixer.phar", "fix-cs": [ "@install-cs", "@php php-cs-fixer.phar fix --diff -v --allow-risky=yes --ansi" @@ -64,6 +64,11 @@ "check-cs": [ "@install-cs", "@php php-cs-fixer.phar fix --dry-run --diff -v --allow-risky=yes --ansi" + ], + "code-quality": [ + "rm composer.lock", + "@composer install --ansi", + "@check-cs" ] } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7b1c44c..26b9fd9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,7 @@ - ./tests/ + tests diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index f00f4d6..881710a 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -39,7 +39,6 @@ public function getConfigTreeBuilder(): TreeBuilder } /** - * @param TreeBuilder $builder * @param string|null $name * @param string $type * diff --git a/src/OverblogGraphiQLBundle.php b/src/OverblogGraphiQLBundle.php index 3b560f3..eb304d4 100644 --- a/src/OverblogGraphiQLBundle.php +++ b/src/OverblogGraphiQLBundle.php @@ -11,7 +11,7 @@ final class OverblogGraphiQLBundle extends Bundle { - public function build(ContainerBuilder $container) : void + public function build(ContainerBuilder $container): void { parent::build($container); @@ -22,7 +22,7 @@ public function build(ContainerBuilder $container) : void $container->addCompilerPass(new DefaultEndpointWiringPass()); } - public function getContainerExtension() : ?ExtensionInterface + public function getContainerExtension(): ?ExtensionInterface { return new OverblogGraphiQLExtension(); } diff --git a/tests/Config/GraphQLEndpoint/RouteResolverTest.php b/tests/Config/GraphQLEndpoint/RouteResolverTest.php index 3c69c23..ad98fcb 100644 --- a/tests/Config/GraphQLEndpoint/RouteResolverTest.php +++ b/tests/Config/GraphQLEndpoint/RouteResolverTest.php @@ -6,8 +6,6 @@ use Overblog\GraphiQLBundle\Config\GraphQLEndpoint\RouteResolver; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; -use Prophecy\Argument; -use Prophecy\Prophecy\ObjectProphecy; use Symfony\Component\Routing\RouterInterface; final class RouteResolverTest extends TestCase @@ -21,8 +19,6 @@ public function setUp(): void } /** - * @param array $routeCollection - * * @return RouteResolver */ private function subject(array $routeCollection) diff --git a/tests/Controller/GraphiQLControllerTest.php b/tests/Controller/GraphiQLControllerTest.php index b8fbbad..2a6674a 100644 --- a/tests/Controller/GraphiQLControllerTest.php +++ b/tests/Controller/GraphiQLControllerTest.php @@ -7,7 +7,7 @@ final class GraphiQLControllerTest extends TestCase { - public function testInvalidSchema() : void + public function testInvalidSchema(): void { $client = static::createClient(); @@ -18,7 +18,7 @@ public function testInvalidSchema() : void $this->assertSame(500, $response->getStatusCode()); } - public function testDefaultSchema() : void + public function testDefaultSchema(): void { $client = static::createClient(); @@ -30,7 +30,7 @@ public function testDefaultSchema() : void $this->stringContains('Loading...', $response->getContent()); } - public function testDefaultSchemaViaMultipleRoute() : void + public function testDefaultSchemaViaMultipleRoute(): void { $client = static::createClient(); diff --git a/tests/TestCase.php b/tests/TestCase.php index e63b38f..4a279d8 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -14,7 +14,7 @@ abstract class TestCase extends WebTestCase /** * {@inheritdoc} */ - protected static function getKernelClass() : string + protected static function getKernelClass(): string { return TestKernel::class; } diff --git a/tests/TestKernel.php b/tests/TestKernel.php index b372f79..bd375af 100644 --- a/tests/TestKernel.php +++ b/tests/TestKernel.php @@ -23,6 +23,7 @@ public function getLogDir(): string { return sys_get_temp_dir().'/OverblogGraphQLBundle/'.Kernel::VERSION.'/'.$this->testCase.'/logs'; } + public function isBooted() { return $this->booted;