diff --git a/src/Annotation/Access.php b/src/Annotation/Access.php index 4a3391424..216f501ff 100644 --- a/src/Annotation/Access.php +++ b/src/Annotation/Access.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL access on fields. * * @Annotation + * @NamedArgumentConstructor * @Target({"CLASS", "PROPERTY", "METHOD"}) */ #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::TARGET_PROPERTY)] -final class Access extends Annotation implements NamedArgumentConstructorAnnotation +final class Access extends Annotation { /** * Field access. diff --git a/src/Annotation/Arg.php b/src/Annotation/Arg.php index 2ab8c4e3c..855375471 100644 --- a/src/Annotation/Arg.php +++ b/src/Annotation/Arg.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL argument. * * @Annotation + * @NamedArgumentConstructor * @Target({"ANNOTATION","PROPERTY","METHOD"}) */ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] -final class Arg extends Annotation implements NamedArgumentConstructorAnnotation +final class Arg extends Annotation { /** * Argument name. diff --git a/src/Annotation/ArgsBuilder.php b/src/Annotation/ArgsBuilder.php index 5e6f3369d..2ab521c15 100644 --- a/src/Annotation/ArgsBuilder.php +++ b/src/Annotation/ArgsBuilder.php @@ -5,11 +5,13 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL args builders. * * @Annotation + * @NamedArgumentConstructor * @Target({"PROPERTY", "METHOD"}) */ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD)] diff --git a/src/Annotation/Builder.php b/src/Annotation/Builder.php index a27104651..beeb1d066 100644 --- a/src/Annotation/Builder.php +++ b/src/Annotation/Builder.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL builders * * @Annotation + * @NamedArgumentConstructor * @Target({"PROPERTY", "METHOD"}) */ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD)] -abstract class Builder extends Annotation implements NamedArgumentConstructorAnnotation +abstract class Builder extends Annotation { /** * Builder name. diff --git a/src/Annotation/Deprecated.php b/src/Annotation/Deprecated.php index f2ffbf388..375efb55f 100644 --- a/src/Annotation/Deprecated.php +++ b/src/Annotation/Deprecated.php @@ -5,22 +5,23 @@ namespace Overblog\GraphQLBundle\Annotation; use \Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL to mark a field as deprecated. * * @Annotation + * @NamedArgumentConstructor * @Target({"METHOD", "PROPERTY"}) */ #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER | Attribute::TARGET_CLASS_CONSTANT)] -final class Deprecated extends Annotation implements NamedArgumentConstructorAnnotation +final class Deprecated extends Annotation { /** * The deprecation reason. * * @Required - * + * * @var string */ public string $value; diff --git a/src/Annotation/Description.php b/src/Annotation/Description.php index be9d72bdb..ae4dd0e82 100644 --- a/src/Annotation/Description.php +++ b/src/Annotation/Description.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL to set a type or field description. * * @Annotation + * @NamedArgumentConstructor * @Target({"CLASS", "METHOD", "PROPERTY"}) */ #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::TARGET_PROPERTY | Attribute::TARGET_PARAMETER | Attribute::TARGET_CLASS_CONSTANT)] -final class Description extends Annotation implements NamedArgumentConstructorAnnotation +final class Description extends Annotation { /** * The object description. diff --git a/src/Annotation/Enum.php b/src/Annotation/Enum.php index 817d98b99..931ff04a0 100644 --- a/src/Annotation/Enum.php +++ b/src/Annotation/Enum.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL enum. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS)] -final class Enum extends Annotation implements NamedArgumentConstructorAnnotation +final class Enum extends Annotation { /** * Enum name. diff --git a/src/Annotation/EnumValue.php b/src/Annotation/EnumValue.php index f546fe8b2..ab7e5705f 100644 --- a/src/Annotation/EnumValue.php +++ b/src/Annotation/EnumValue.php @@ -4,15 +4,16 @@ namespace Overblog\GraphQLBundle\Annotation; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL enum value. * * @Annotation + * @NamedArgumentConstructor * @Target({"ANNOTATION", "CLASS"}) */ -final class EnumValue extends Annotation implements NamedArgumentConstructorAnnotation +final class EnumValue extends Annotation { /** * @var string diff --git a/src/Annotation/Field.php b/src/Annotation/Field.php index 1e63b7a5d..b088ce7f5 100644 --- a/src/Annotation/Field.php +++ b/src/Annotation/Field.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL field. * * @Annotation + * @NamedArgumentConstructor * @Target({"PROPERTY", "METHOD"}) */ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD)] -class Field extends Annotation implements NamedArgumentConstructorAnnotation +class Field extends Annotation { /** * The field name. diff --git a/src/Annotation/FieldBuilder.php b/src/Annotation/FieldBuilder.php index 0ba3d151b..01b5bdb83 100644 --- a/src/Annotation/FieldBuilder.php +++ b/src/Annotation/FieldBuilder.php @@ -5,15 +5,16 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL field builders. * * @Annotation + * @NamedArgumentConstructor * @Target({"PROPERTY", "METHOD"}) */ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::TARGET_METHOD)] -final class FieldBuilder extends Builder implements NamedArgumentConstructorAnnotation +final class FieldBuilder extends Builder { } diff --git a/src/Annotation/FieldsBuilder.php b/src/Annotation/FieldsBuilder.php index f831eb8b5..8ac589408 100644 --- a/src/Annotation/FieldsBuilder.php +++ b/src/Annotation/FieldsBuilder.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL fields builders. * * @Annotation + * @NamedArgumentConstructor * @Target({"ANNOTATION", "CLASS"}) */ #[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] -final class FieldsBuilder extends Builder implements NamedArgumentConstructorAnnotation +final class FieldsBuilder extends Builder { public function __construct(string $name = null, array $config = null, string $builder = null, array $builderConfig = null) { diff --git a/src/Annotation/Input.php b/src/Annotation/Input.php index 2dcdc2d99..cdbf0e936 100644 --- a/src/Annotation/Input.php +++ b/src/Annotation/Input.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL input type. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS)] -final class Input extends Annotation implements NamedArgumentConstructorAnnotation +final class Input extends Annotation { /** * Type name. diff --git a/src/Annotation/IsPublic.php b/src/Annotation/IsPublic.php index 8663e882c..fd6dfc9d5 100644 --- a/src/Annotation/IsPublic.php +++ b/src/Annotation/IsPublic.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL public on fields. * * @Annotation + * @NamedArgumentConstructor * @Target({"CLASS", "METHOD", "PROPERTY"}) */ #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::TARGET_PROPERTY)] -final class IsPublic extends Annotation implements NamedArgumentConstructorAnnotation +final class IsPublic extends Annotation { /** * Field publicity. diff --git a/src/Annotation/Mutation.php b/src/Annotation/Mutation.php index 72cfa0725..8e0d29ddb 100644 --- a/src/Annotation/Mutation.php +++ b/src/Annotation/Mutation.php @@ -5,11 +5,13 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL mutation. * * @Annotation + * @NamedArgumentConstructor * @Target({"METHOD"}) */ #[Attribute(Attribute::TARGET_METHOD)] diff --git a/src/Annotation/Provider.php b/src/Annotation/Provider.php index 7ff8bd5fd..76be855c2 100644 --- a/src/Annotation/Provider.php +++ b/src/Annotation/Provider.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for operations provider. * * @Annotation + * @NamedArgumentConstructor * @Target({"CLASS"}) */ #[Attribute(Attribute::TARGET_CLASS)] -final class Provider extends Annotation implements NamedArgumentConstructorAnnotation +final class Provider extends Annotation { /** * Optionnal prefix for provider fields. diff --git a/src/Annotation/Query.php b/src/Annotation/Query.php index d6985ca5e..4269bac84 100644 --- a/src/Annotation/Query.php +++ b/src/Annotation/Query.php @@ -5,11 +5,13 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL query. * * @Annotation + * @NamedArgumentConstructor * @Target({"METHOD"}) */ #[Attribute(Attribute::TARGET_METHOD)] diff --git a/src/Annotation/Relay/Connection.php b/src/Annotation/Relay/Connection.php index 8f79648f4..e97174b13 100644 --- a/src/Annotation/Relay/Connection.php +++ b/src/Annotation/Relay/Connection.php @@ -5,7 +5,7 @@ namespace Overblog\GraphQLBundle\Annotation\Relay; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; use Overblog\GraphQLBundle\Annotation\Annotation; use Overblog\GraphQLBundle\Annotation\Type; @@ -13,10 +13,11 @@ * Annotation for GraphQL relay connection. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS)] -final class Connection extends Type implements NamedArgumentConstructorAnnotation +final class Connection extends Type { /** * Connection Edge type. diff --git a/src/Annotation/Relay/Edge.php b/src/Annotation/Relay/Edge.php index 95299f4bd..9a29c839f 100644 --- a/src/Annotation/Relay/Edge.php +++ b/src/Annotation/Relay/Edge.php @@ -5,7 +5,7 @@ namespace Overblog\GraphQLBundle\Annotation\Relay; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; use Overblog\GraphQLBundle\Annotation\Annotation; use Overblog\GraphQLBundle\Annotation\Type; @@ -13,10 +13,11 @@ * Annotation for GraphQL connection edge. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS)] -final class Edge extends Type implements NamedArgumentConstructorAnnotation +final class Edge extends Type { /** * Edge Node type. diff --git a/src/Annotation/Scalar.php b/src/Annotation/Scalar.php index a93c36aeb..13c2db6ca 100644 --- a/src/Annotation/Scalar.php +++ b/src/Annotation/Scalar.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL scalar. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)] -final class Scalar extends Annotation implements NamedArgumentConstructorAnnotation +final class Scalar extends Annotation { public ?string $name; diff --git a/src/Annotation/Type.php b/src/Annotation/Type.php index 3e504267f..b55ce7dce 100644 --- a/src/Annotation/Type.php +++ b/src/Annotation/Type.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL type. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS)] -class Type extends Annotation implements NamedArgumentConstructorAnnotation +class Type extends Annotation { /** * Type name. diff --git a/src/Annotation/TypeInterface.php b/src/Annotation/TypeInterface.php index 3cf9b61f9..f1c83ffbc 100644 --- a/src/Annotation/TypeInterface.php +++ b/src/Annotation/TypeInterface.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL interface. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS)] -final class TypeInterface extends Annotation implements NamedArgumentConstructorAnnotation +final class TypeInterface extends Annotation { /** * Interface name. @@ -30,8 +31,12 @@ final class TypeInterface extends Annotation implements NamedArgumentConstructor * @param string|null $name The GraphQL name of the interface * @param string $resolveType The express resolve type */ - public function __construct(string $name = null, string $resolveType) + public function __construct(string $name = null, string $resolveType = null) { + // TODO: 1.0: Remove optionality for both parameters. + // Previously, only the name was optional, but resolveType was always required + // But in PHP 8.1 you cannot define an optional parameter before a required one. + // To not break BC we now also make the resolveType optional. $this->name = $name; $this->resolveType = $resolveType; } diff --git a/src/Annotation/Union.php b/src/Annotation/Union.php index 500ad747f..dd32b3c45 100644 --- a/src/Annotation/Union.php +++ b/src/Annotation/Union.php @@ -5,16 +5,17 @@ namespace Overblog\GraphQLBundle\Annotation; use Attribute; -use Doctrine\Common\Annotations\NamedArgumentConstructorAnnotation; +use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor; /** * Annotation for GraphQL union. * * @Annotation + * @NamedArgumentConstructor * @Target("CLASS") */ #[Attribute(Attribute::TARGET_CLASS)] -final class Union extends Annotation implements NamedArgumentConstructorAnnotation +final class Union extends Annotation { /** * Union name.