Skip to content

Commit

Permalink
Merge pull request #4 from x-graphql/feat/add-easy-coding-standard
Browse files Browse the repository at this point in the history
feat: add ecs
  • Loading branch information
vuongxuongminh authored Feb 22, 2024
2 parents 159227e + 149a1f1 commit 251a400
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"sort-packages": true
},
"require-dev": {
"phpunit/phpunit": "^11.0"
"phpunit/phpunit": "^11.0",
"symplify/easy-coding-standard": "^12.1"
}
}
18 changes: 18 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return ECSConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])

// add a single rule
->withRules([
NoUnusedImportsFixer::class,
])
->withPreparedSets(psr12: true, strict: true);
2 changes: 1 addition & 1 deletion src/SchemaPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static function printSchemaExcludeTypeSystemDirectives(Schema $schema, ar
return self::printFilteredSchema(
$schema,
$directivesFilter,
static fn(NamedType $type): bool => !$type->isBuiltInType(),
static fn (NamedType $type): bool => !$type->isBuiltInType(),
$options
);
}
Expand Down
1 change: 0 additions & 1 deletion src/Variable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use GraphQL\Language\AST\ValueNode;
use GraphQL\Language\AST\VariableNode;


final readonly class Variable
{
/**
Expand Down
2 changes: 1 addition & 1 deletion tests/SchemaPrinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

use GraphQL\Utils\BuildSchema;
use PHPUnit\Framework\Attributes\DataProvider;
use XGraphQL\Utils\SchemaPrinter;
use PHPUnit\Framework\TestCase;
use XGraphQL\Utils\SchemaPrinter;

class SchemaPrinterTest extends TestCase
{
Expand Down

0 comments on commit 251a400

Please sign in to comment.