Skip to content

Commit 47beafc

Browse files
committed
Fix coding standard
1 parent 8b2b4d5 commit 47beafc

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/Utils/AST.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ public static function getOperation(DocumentNode $document, $operationName = nul
637637
*
638638
* @api
639639
*/
640-
public static function getOperationAST(DocumentNode $document, ?string $operationName = null) : ?OperationDefinitionNode
640+
public static function getOperationAST(DocumentNode $document, ?string $operationName = null): ?OperationDefinitionNode
641641
{
642642
$operation = null;
643643
foreach ($document->definitions->getIterator() as $node) {
@@ -650,6 +650,7 @@ public static function getOperationAST(DocumentNode $document, ?string $operatio
650650
if ($operation !== null) {
651651
return null;
652652
}
653+
653654
$operation = $node;
654655
} elseif ($node->name instanceof NameNode && $node->name->value === $operationName) {
655656
return $node;

tests/Utils/AstGetOperationAstTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
use GraphQL\Utils\AST;
99
use PHPUnit\Framework\TestCase;
1010

11-
class AstGetOperationAstTest extends TestCase
11+
final class AstGetOperationAstTest extends TestCase
1212
{
1313
// Describe: getOperationAST
1414

1515
/**
1616
* @see it('Gets an operation from a simple document')
1717
*/
18-
public function testGetsAnOperationFromASimpleDocument() : void
18+
public function testGetsAnOperationFromASimpleDocument(): void
1919
{
2020
$doc = Parser::parse('{ field }');
2121
self::assertEquals(
@@ -27,7 +27,7 @@ public function testGetsAnOperationFromASimpleDocument() : void
2727
/**
2828
* @see it('Gets an operation from a document with named op (mutation)')
2929
*/
30-
public function testGetsAnOperationFromADcoumentWithNamedOpMutation() : void
30+
public function testGetsAnOperationFromADcoumentWithNamedOpMutation(): void
3131
{
3232
$doc = Parser::parse('mutation Test { field }');
3333
self::assertEquals(AST::getOperationAST($doc), $doc->definitions->offsetGet(0));
@@ -36,7 +36,7 @@ public function testGetsAnOperationFromADcoumentWithNamedOpMutation() : void
3636
/**
3737
* @see it('Gets an operation from a document with named op (subscription)')
3838
*/
39-
public function testGetsAnOperationFromADcoumentWithNamedOpSubscription() : void
39+
public function testGetsAnOperationFromADcoumentWithNamedOpSubscription(): void
4040
{
4141
$doc = Parser::parse('subscription Test { field }');
4242
self::assertEquals(AST::getOperationAST($doc), $doc->definitions->offsetGet(0));
@@ -45,7 +45,7 @@ public function testGetsAnOperationFromADcoumentWithNamedOpSubscription() : void
4545
/**
4646
* @see it('Does not get missing operation')
4747
*/
48-
public function testDoesNotGetMissingOperation() : void
48+
public function testDoesNotGetMissingOperation(): void
4949
{
5050
$doc = Parser::parse('type Foo { field: String }');
5151
self::assertEquals(AST::getOperationAST($doc), null);
@@ -54,7 +54,7 @@ public function testDoesNotGetMissingOperation() : void
5454
/**
5555
* @see it('Does not get ambiguous unnamed operation')
5656
*/
57-
public function testDoesNotGetAmbiguousUnnamedOperation() : void
57+
public function testDoesNotGetAmbiguousUnnamedOperation(): void
5858
{
5959
$doc = Parser::parse('
6060
{ field }
@@ -67,7 +67,7 @@ public function testDoesNotGetAmbiguousUnnamedOperation() : void
6767
/**
6868
* @see it('Does not get ambiguous named operation')
6969
*/
70-
public function testDoesNotGetAmbiguousNamedOperation() : void
70+
public function testDoesNotGetAmbiguousNamedOperation(): void
7171
{
7272
$doc = Parser::parse('
7373
query TestQ { field }
@@ -80,7 +80,7 @@ public function testDoesNotGetAmbiguousNamedOperation() : void
8080
/**
8181
* @see it('Does not get misnamed operation')
8282
*/
83-
public function testDoesNotGetMisnamedOperation() : void
83+
public function testDoesNotGetMisnamedOperation(): void
8484
{
8585
$doc = Parser::parse('
8686
{ field }
@@ -94,7 +94,7 @@ public function testDoesNotGetMisnamedOperation() : void
9494
/**
9595
* @see it('Gets named operation')
9696
*/
97-
public function testGetsNamedOperation() : void
97+
public function testGetsNamedOperation(): void
9898
{
9999
$doc = Parser::parse('
100100
query TestQ { field }

0 commit comments

Comments
 (0)