Skip to content

Commit ef76233

Browse files
committed
reformat code
1 parent fe0cc84 commit ef76233

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

phpunit.xml.dist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
bootstrap="tests/bootstrap.php">
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5+
bootstrap="tests/bootstrap.php">
66
<coverage>
77
<include>
88
<directory suffix=".php">./src</directory>

src/Parser/Parser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ public function parse($string)
4141
$this->lookahead = $this->tokenizer->getNextToken();
4242

4343
// try parsing the document -> if it fails, add error to the errors
44-
try{
44+
try {
4545
// entry point for parsing
4646
$this->document = $this->Document();
47-
}catch (GraphQLError $error){
47+
} catch (GraphQLError $error) {
4848
$this->errors[] = $error;
4949
}
5050
}
5151

5252
/**
5353
* @return bool
5454
*/
55-
public function queryIsValid() : bool
55+
public function queryIsValid(): bool
5656
{
5757
return count($this->errors) === 0;
5858
}

src/Servers/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function listen()
7171
$this->parser->parse($query);
7272

7373
// check if is valid
74-
if(!$this->parser->queryIsValid()){
74+
if (!$this->parser->queryIsValid()) {
7575
// if invalid -> show errors
7676
$this->returnData([
7777
"errors" => Errors::prettyPrintErrors($this->parser->getErrors())

tests/Errors/ErrorTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
use \PHPUnit\Framework\TestCase;
44
use \GraphQL\Errors\GraphQLError;
55

6-
class ErrorTest extends TestCase {
6+
class ErrorTest extends TestCase
7+
{
78

89
/**
910
* check if node can be converted into location correctly
1011
*/
11-
public function testConvertNodeToPosition(){
12+
public function testConvertNodeToPosition()
13+
{
1214
$node = [
1315
// ... more properties of node
1416
"loc" => [

tests/StarWarsSchema.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
use GraphQL\Arguments\GraphQLFieldArgument;
1414
use GraphQL\Schemas\Schema;
1515

16-
class StarWarsSchema{
16+
class StarWarsSchema
17+
{
1718
private static $humans = [
1819
"1000" => ["type" => "human", "id" => "1000", "name" => "Luke Skywalker", "friends" => ["1002", "1003", "2000", "2001"], "appearsIn" => ["NEW_HOPE", "EMPIRE", "JEDI"], "homePlanet" => "Tatooine"],
1920
"1001" => ["type" => "human", "id" => "1001", "name" => "Darth Vader", "friends" => ["1004"], "appearsIn" => ["NEW_HOPE", "EMPIRE", "JEDI"], "homePlanet" => "Tatooine"],

0 commit comments

Comments
 (0)