Skip to content

Replace deprecated NamedArgumentConstructorAnnotation with @NamedArgumentConstructor + Address one PHP 8.1 deprecation #941

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 2 commits into from
Dec 6, 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
5 changes: 3 additions & 2 deletions src/Annotation/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Arg.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/Annotation/ArgsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions src/Annotation/Deprecated.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Description.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/EnumValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/FieldBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
}
5 changes: 3 additions & 2 deletions src/Annotation/FieldsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/IsPublic.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/Annotation/Mutation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions src/Annotation/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Relay/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
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;

/**
* 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.
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Relay/Edge.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
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;

/**
* 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.
Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Scalar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 3 additions & 2 deletions src/Annotation/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading