Skip to content

Fix CS #846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/Config/Parser/fixtures/annotations/Enum/Race.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* @GQL\Description("The list of races!")
*/
#[GQL\Enum]
#[GQL\Description("The list of races!")]
#[GQL\Description('The list of races!')]
class Race
{
public const HUMAIN = 1;

#[GQL\Description("The Chiss race")]
#[GQL\Description('The Chiss race')]
public const CHISS = '2';

#[GQL\Deprecated("The Zabraks have been wiped out")]
#[GQL\Deprecated('The Zabraks have been wiped out')]
public const ZABRAK = '3';
public const TWILEK = Constants::TWILEK;

Expand Down
8 changes: 4 additions & 4 deletions tests/Config/Parser/fixtures/annotations/Input/Planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@
* @GQL\Description("Planet Input type description")
*/
#[GQL\Input]
#[GQL\Description("Planet Input type description")]
#[GQL\Description('Planet Input type description')]
class Planet
{
/**
* @GQL\Field(resolve="...")
*/
#[GQL\Field(resolve: "...")]
#[GQL\Field(resolve: '...')]
protected string $skipField;

/**
* @GQL\Field(type="String!")
*/
#[GQL\Field(type: "String!")]
#[GQL\Field(type: 'String!')]
protected string $name;

/**
* @GQL\Field(type="Int!")
*/
#[GQL\Field(type: "Int!")]
#[GQL\Field(type: 'Int!')]
protected string $population;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class InvalidAccess
/**
* @GQL\Access("access")
*/
#[GQL\Access("access")]
#[GQL\Access('access')]
protected string $field;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class InvalidArgumentGuessing
*
* @param mixed $test
*/
#[GQL\Field(name: "guessFailed")]
#[GQL\Field(name: 'guessFailed')]
public function guessFail($test): int
{
return 12;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class InvalidProvider
/**
* @GQL\Query(type="Int", targetType="RootMutation2")
*/
#[GQL\Query(type: "Int", targetType: "RootMutation2")]
#[GQL\Query(type: 'Int', targetType: 'RootMutation2')]
public function noQueryOnMutation(): array
{
return [];
Expand All @@ -24,7 +24,7 @@ public function noQueryOnMutation(): array
/**
* @GQL\Mutation(type="Int", targetType="RootQuery2")
*/
#[GQL\Mutation(type: "Int", targetType: "RootQuery2")]
#[GQL\Mutation(type: 'Int', targetType: 'RootQuery2')]
public function noMutationOnQuery(): array
{
return [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class InvalidReturnTypeGuessing
* @GQL\Field(name="guessFailed")
* @phpstan-ignore-next-line
*/
#[GQL\Field(name: "guessFailed")]
#[GQL\Field(name: 'guessFailed')]

// @phpstan-ignore-next-line
public function guessFail(int $test)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @GQL\Union(types={"Hero", "Droid", "Sith"})
*/
#[GQL\Union(types: ["Hero", "Droid", "Sith"])]
#[GQL\Union(types: ['Hero', 'Droid', 'Sith'])]
class InvalidUnion
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* @GQL\Relay\Connection(node="Character")
*/
#[GQL\Relay\Connection(node: "Character")]
#[GQL\Relay\Connection(node: 'Character')]
class EnemiesConnection extends Connection
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* @GQL\Relay\Connection(edge="FriendsConnectionEdge")
*/
#[GQL\Relay\Connection(edge: "FriendsConnectionEdge")]
#[GQL\Relay\Connection(edge: 'FriendsConnectionEdge')]
class FriendsConnection extends Connection
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* @GQL\Relay\Edge(node="Character")
*/
#[GQL\Relay\Edge(node: "Character")]
#[GQL\Relay\Edge(node: 'Character')]
class FriendsConnectionEdge extends Edge
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
* @GQL\Access("default_access")
* @GQL\IsPublic("default_public")
*/
#[GQL\Provider(prefix: "planet_")]
#[GQL\Access("default_access")]
#[GQL\IsPublic("default_public")]
#[GQL\Provider(prefix: 'planet_')]
#[GQL\Access('default_access')]
#[GQL\IsPublic('default_public')]
class PlanetRepository
{
/**
* @GQL\Query(type="[Planet]")
* @GQL\Arg(type="String!", name="keyword")
*/
#[GQL\Query(type: "[Planet]")]
#[GQL\Arg(type: "String!", name: "keyword")]
#[GQL\Query(type: '[Planet]')]
#[GQL\Arg(type: 'String!', name: 'keyword')]
public function searchPlanet(string $keyword): array
{
return [];
Expand All @@ -32,8 +32,8 @@ public function searchPlanet(string $keyword): array
* @GQL\Query(type="[Planet]")
* @GQL\Arg(type="Int!", name="distance")
*/
#[GQL\Query(type: "[Planet]")]
#[GQL\Arg(type: "Int!", name: "distance")]
#[GQL\Query(type: '[Planet]')]
#[GQL\Arg(type: 'Int!', name: 'distance')]
public function searchStar(int $distance): array
{
return [];
Expand All @@ -44,9 +44,9 @@ public function searchStar(int $distance): array
* @GQL\Arg(type="PlanetInput!", name="planetInput")
* @GQL\IsPublic("override_public")
*/
#[GQL\Mutation(type: "Planet")]
#[GQL\Arg(type: "PlanetInput!", name: "planetInput")]
#[GQL\IsPublic("override_public")]
#[GQL\Mutation(type: 'Planet')]
#[GQL\Arg(type: 'PlanetInput!', name: 'planetInput')]
#[GQL\IsPublic('override_public')]
public function createPlanet(array $planetInput): array
{
return [];
Expand All @@ -56,8 +56,8 @@ public function createPlanet(array $planetInput): array
* @GQL\Query(type="[Planet]", targetType="Droid", name="allowedPlanets")
* @GQL\Access("override_access")
*/
#[GQL\Query(type: "[Planet]", targetType: "Droid", name: "allowedPlanets")]
#[GQL\Access("override_access")]
#[GQL\Query(type: '[Planet]', targetType: 'Droid', name: 'allowedPlanets')]
#[GQL\Access('override_access')]
public function getAllowedPlanetsForDroids(): array
{
return [];
Expand All @@ -66,7 +66,7 @@ public function getAllowedPlanetsForDroids(): array
/**
* @GQL\Query(type="Planet", targetTypes="RootQuery2")
*/
#[GQL\Query(type: "Planet", targetType: "RootQuery2")]
#[GQL\Query(type: 'Planet', targetType: 'RootQuery2')]
public function getPlanetSchema2(): ?Planet
{
return null;
Expand All @@ -77,9 +77,9 @@ public function getPlanetSchema2(): ?Planet
* @GQL\Arg(type="PlanetInput!", name="planetInput")
* @GQL\IsPublic("override_public")
*/
#[GQL\Mutation(type: "Planet", targetTypes: "RootMutation2")]
#[GQL\Arg(type: "PlanetInput!", name: "planetInput")]
#[GQL\IsPublic("override_public")]
#[GQL\Mutation(type: 'Planet', targetTypes: 'RootMutation2')]
#[GQL\Arg(type: 'PlanetInput!', name: 'planetInput')]
#[GQL\IsPublic('override_public')]
public function createPlanetSchema2(array $planetInput): array
{
return [];
Expand All @@ -88,7 +88,7 @@ public function createPlanetSchema2(array $planetInput): array
/**
* @GQL\Mutation(targetTypes={"RootMutation", "RootMutation2"})
*/
#[GQL\Mutation(targetTypes: ["RootMutation", "RootMutation2"])]
#[GQL\Mutation(targetTypes: ['RootMutation', 'RootMutation2'])]
public function destroyPlanet(int $planetId): bool
{
return true;
Expand All @@ -97,7 +97,7 @@ public function destroyPlanet(int $planetId): bool
/**
* @GQL\Query(targetTypes={"RootQuery", "RootQuery2"})
*/
#[GQL\Query(targetTypes: ["RootQuery", "RootQuery2"])]
#[GQL\Query(targetTypes: ['RootQuery', 'RootQuery2'])]
public function isPlanetDestroyed(int $planetId): bool
{
return true;
Expand All @@ -106,7 +106,7 @@ public function isPlanetDestroyed(int $planetId): bool
/**
* @GQL\Query(targetTypes={"Droid", "Mandalorian"}, name="armorResistance")
*/
#[GQL\Query(name: "armorResistance", targetTypes: ["Droid", "Mandalorian"])]
#[GQL\Query(name: 'armorResistance', targetTypes: ['Droid', 'Mandalorian'])]
public function getArmorResistance(): int
{
return 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @GQL\Provider(targetQueryTypes={"RootQuery2"}, targetMutationTypes="RootMutation2")
*/
#[GQL\Provider(targetQueryTypes: ["RootQuery2"], targetMutationTypes: "RootMutation2")]
#[GQL\Provider(targetQueryTypes: ['RootQuery2'], targetMutationTypes: 'RootMutation2')]
class WeaponRepository
{
/**
Expand All @@ -24,7 +24,7 @@ public function hasSecretWeapons(): bool
/**
* @GQL\Query(targetTypes="RootQuery")
*/
#[GQL\Query(targetTypes: "RootQuery")]
#[GQL\Query(targetTypes: 'RootQuery')]
public function countSecretWeapons(): int
{
return 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @GQL\Description("The galaxy coordinates scalar")
*/
#[GQL\Scalar]
#[GQL\Description("The galaxy coordinates scalar")]
#[GQL\Description('The galaxy coordinates scalar')]
class GalaxyCoordinates
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @GQL\Scalar(name="MyScalar", scalarType="newObject('App\\Type\\EmailType')")
*/
#[GQL\Scalar(name: "MyScalar", scalarType: "newObject('App\\Type\\EmailType')")]
#[GQL\Scalar(name: 'MyScalar', scalarType: "newObject('App\\Type\\EmailType')")]
class MyScalar2
{
}
8 changes: 4 additions & 4 deletions tests/Config/Parser/fixtures/annotations/Type/Animal.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
* @GQL\Description("The character interface")
*/
#[GQL\Type]
#[GQL\Description("The character interface")]
#[GQL\Description('The character interface')]
abstract class Animal
{
/**
* @GQL\Field(type="String!")
* @GQL\Description("The name of the animal")
*/
#[GQL\Field(type: "String!")]
#[GQL\Description("The name of the animal")]
#[GQL\Field(type: 'String!')]
#[GQL\Description('The name of the animal')]
private string $name;

/**
* @GQL\Field(type="String!")
*/
#[GQL\Field(type: "String!")]
#[GQL\Field(type: 'String!')]
private string $lives;
}
4 changes: 2 additions & 2 deletions tests/Config/Parser/fixtures/annotations/Type/Armored.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* @GQL\TypeInterface(name="WithArmor", resolveType="@=resolver('character_type', [value])")
* @GQL\Description("The armored interface")
*/
#[GQL\TypeInterface("WithArmor", resolveType: "@=resolver('character_type', [value])")]
#[GQL\Description("The armored interface")]
#[GQL\TypeInterface('WithArmor', resolveType: "@=resolver('character_type', [value])")]
#[GQL\Description('The armored interface')]
interface Armored
{
}
4 changes: 2 additions & 2 deletions tests/Config/Parser/fixtures/annotations/Type/Battle.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class Battle
/**
* @GQL\Field(type="Planet", complexity="100 + childrenComplexity")
*/
#[GQL\Field(type: "Planet", complexity: "100 + childrenComplexity")]
#[GQL\Field(type: 'Planet', complexity: '100 + childrenComplexity')]
protected object $planet;

/**
* @GQL\Field(name="casualties", complexity="childrenComplexity * 5")
*/
#[GQL\Field(name: "casualties", complexity: "childrenComplexity * 5")]
#[GQL\Field(name: 'casualties', complexity: 'childrenComplexity * 5')]
public function getCasualties(
int $areaId,
string $raceId,
Expand Down
4 changes: 2 additions & 2 deletions tests/Config/Parser/fixtures/annotations/Type/Cat.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
* @GQL\Description("The Cat type")
*/
#[GQL\Type]
#[GQL\Description("The Cat type")]
#[GQL\Description('The Cat type')]
class Cat extends Animal
{
/**
* @GQL\Field(type="Int!")
*/
#[GQL\Field(type: "Int!")]
#[GQL\Field(type: 'Int!')]
protected int $lives;

/**
Expand Down
10 changes: 5 additions & 5 deletions tests/Config/Parser/fixtures/annotations/Type/Character.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
* @GQL\Description("The character interface")
*/
#[GQL\TypeInterface(resolveType: "@=resolver('character_type', [value])")]
#[GQL\Description("The character interface")]
#[GQL\Description('The character interface')]
abstract class Character
{
/**
* @GQL\Field(type="String!")
* @GQL\Description("The name of the character")
*/
#[GQL\Field(type: "String!")]
#[GQL\Description("The name of the character")]
#[GQL\Field(type: 'String!')]
#[GQL\Description('The name of the character')]
protected string $name;

/**
* @GQL\Field(type="[Character]", resolve="@=resolver('App\MyResolver::getFriends')")
* @GQL\Description("The friends of the character")
*/
#[GQL\Field(type: "[Character]", resolve: "@=resolver('App\MyResolver::getFriends')")]
#[GQL\Description("The friends of the character")]
#[GQL\Field(type: '[Character]', resolve: "@=resolver('App\MyResolver::getFriends')")]
#[GQL\Description('The friends of the character')]
protected array $friends;
}
4 changes: 2 additions & 2 deletions tests/Config/Parser/fixtures/annotations/Type/Crystal.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
* @GQL\FieldsBuilder(name="MyFieldsBuilder", config={"param1": "val1"})
*/
#[GQL\Type]
#[GQL\FieldsBuilder(name: "MyFieldsBuilder", config: ["param1" => "val1"])]
#[GQL\FieldsBuilder(name: 'MyFieldsBuilder', config: ['param1' => 'val1'])]
class Crystal
{
/**
* @GQL\Field(type="String!")
*/
#[GQL\Field(type: "String!")]
#[GQL\Field(type: 'String!')]
protected string $color;
}
2 changes: 1 addition & 1 deletion tests/Config/Parser/fixtures/annotations/Type/Droid.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @GQL\Description("The Droid type")
*/
#[GQL\Type(isTypeOf: "@=isTypeOf('App\Entity\Droid')")]
#[GQL\Description("The Droid type")]
#[GQL\Description('The Droid type')]
class Droid extends Character
{
/**
Expand Down
Loading