Skip to content

Commit 8d989e2

Browse files
authored
Merge pull request #1051 from sparklink-pro/phpcs
Update PHPCs to latest version & fix files
2 parents d9ddb64 + 3d0cad9 commit 8d989e2

File tree

138 files changed

+186
-52
lines changed

Some content is hidden

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

138 files changed

+186
-52
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"static-analysis": [
9292
"phpstan analyse --ansi --memory-limit=1G"
9393
],
94-
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.3.2/php-cs-fixer.phar -O php-cs-fixer.phar",
94+
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v3.11.0/php-cs-fixer.phar -O php-cs-fixer.phar",
9595
"fix-cs": [
9696
"@install-cs",
9797
"@php php-cs-fixer.phar fix --diff -v --allow-risky=yes --ansi"

src/Command/DebugCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Symfony\Component\Console\Input\InputOption;
1212
use Symfony\Component\Console\Output\OutputInterface;
1313
use Symfony\Component\Console\Style\SymfonyStyle;
14+
1415
use function array_diff;
1516
use function array_keys;
1617
use function implode;

src/Command/GraphQLDumpSchemaCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@
1313
use Symfony\Component\Console\Input\InputOption;
1414
use Symfony\Component\Console\Output\OutputInterface;
1515
use Symfony\Component\Console\Style\SymfonyStyle;
16+
1617
use function file_put_contents;
1718
use function json_encode;
1819
use function realpath;
1920
use function sprintf;
2021
use function strtolower;
22+
2123
use const JSON_PRETTY_PRINT;
2224

2325
final class GraphQLDumpSchemaCommand extends Command

src/Config/EnumTypeDefinition.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Overblog\GraphQLBundle\Config;
66

77
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
8+
89
use function array_key_exists;
910
use function is_array;
1011
use function is_null;

src/Config/InputObjectTypeDefinition.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Overblog\GraphQLBundle\Config;
66

77
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
8+
89
use function is_string;
910

1011
final class InputObjectTypeDefinition extends TypeDefinition

src/Config/ObjectTypeDefinition.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
88
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
9+
910
use function array_key_exists;
1011

1112
final class ObjectTypeDefinition extends TypeWithOutputFieldsDefinition

src/Config/Parser/GraphQL/ASTConverter/DescriptionNode.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use GraphQL\Language\AST\Node;
88
use GraphQL\Language\AST\StringValueNode;
9+
910
use function trim;
1011

1112
final class DescriptionNode implements NodeInterface

src/Config/Parser/GraphQLParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
use Symfony\Component\Config\Resource\FileResource;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
1717
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
18+
1819
use function array_keys;
1920
use function array_pop;
2021
use function call_user_func;
2122
use function explode;
2223
use function file_get_contents;
23-
use function get_class;
2424
use function in_array;
2525
use function preg_replace;
2626
use function sprintf;
@@ -79,7 +79,7 @@ public static function parse(SplFileInfo $file, ContainerBuilder $container, arr
7979

8080
private static function throwUnsupportedDefinitionNode(DefinitionNode $typeDef): void
8181
{
82-
$path = explode('\\', get_class($typeDef));
82+
$path = explode('\\', $typeDef::class);
8383
throw new InvalidArgumentException(
8484
sprintf(
8585
'%s definition is not supported right now.',

src/Config/Parser/MetadataParser/MetadataParser.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Symfony\Component\Config\Resource\FileResource;
2626
use Symfony\Component\DependencyInjection\ContainerBuilder;
2727
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
28+
2829
use function array_filter;
2930
use function array_keys;
3031
use function array_map;
@@ -250,6 +251,7 @@ private static function classMetadatasToGQLConfiguration(
250251

251252
/**
252253
* @throws ReflectionException
254+
*
253255
* @phpstan-param class-string $className
254256
*/
255257
private static function getClassReflection(string $className): ReflectionClass
@@ -510,9 +512,9 @@ private static function unionMetadataToGQLConfiguration(ReflectionClass $reflect
510512
* @phpstan-param ReflectionMethod|ReflectionProperty $reflector
511513
* @phpstan-param class-string<Metadata\Field> $fieldMetadataName
512514
*
513-
* @throws AnnotationException
514-
*
515515
* @return array<string,array>
516+
*
517+
* @throws AnnotationException
516518
*/
517519
private static function getTypeFieldConfigurationFromReflector(ReflectionClass $reflectionClass, Reflector $reflector, string $fieldMetadataName, string $currentValue = 'value'): array
518520
{
@@ -623,9 +625,9 @@ private static function getTypeFieldConfigurationFromReflector(ReflectionClass $
623625
*
624626
* @param ReflectionProperty[] $reflectors
625627
*
626-
* @throws AnnotationException
627-
*
628628
* @return array<string,array>
629+
*
630+
* @throws AnnotationException
629631
*/
630632
private static function getGraphQLInputFieldsFromMetadatas(ReflectionClass $reflectionClass, array $reflectors): array
631633
{
@@ -832,7 +834,9 @@ private static function formatNamespaceForExpression(string $namespace): string
832834
* Get the first metadata matching given class.
833835
*
834836
* @phpstan-template T of object
837+
*
835838
* @phpstan-param class-string<T>|class-string<T>[] $metadataClasses
839+
*
836840
* @phpstan-return T|null
837841
*
838842
* @return object|null
@@ -848,6 +852,7 @@ private static function getFirstMetadataMatching(array $metadatas, $metadataClas
848852
* Return the metadata matching given class
849853
*
850854
* @phpstan-template T of object
855+
*
851856
* @phpstan-param class-string<T>|class-string<T>[] $metadataClasses
852857
*
853858
* @return array

src/Config/Parser/MetadataParser/TypeGuesser/DocBlockTypeGuesser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use ReflectionMethod;
2020
use ReflectionProperty;
2121
use Reflector;
22+
2223
use function sprintf;
2324

2425
final class DocBlockTypeGuesser extends PhpTypeGuesser

0 commit comments

Comments
 (0)