overblog / GraphQLBundle

This bundle provides tools to build a complete GraphQL API server in your Symfony App.
MIT License
788 stars 222 forks source link

Annotations should be deprecated #1173

Open Vincz opened 7 months ago

Vincz commented 7 months ago
Q A
Bug report? yes/no
Feature request? yes/no
BC Break report? yes/no
RFC? yes/no
Version/Branch x.y.z

Attributes have been around for a while now. We should deprecate annotations as the minimum requirement is now PHP >= 8.

Vincz commented 7 months ago

We should also update the folder and the namespace and deprecate the old one. @mcg-web I have never done something like that. Is there a way to deprecate the old namespace and folder (but let it work) while having the new one without duplicating the files in it?

Vincz commented 7 months ago

One way to to it would be to subclass new namespace with the old one. For example:

<?php

namespace Overblog\GraphQLBundle\Annotation;

use Overblog\GraphQLBundle\Annotation\Type as BaseType;

class Type extends BaseType
{
}

Not sure if it would work.

Vincz commented 7 months ago

Another way would be with composer autoload. Would something like this could work in the composer.json ?

    "autoload": {
        "psr-4": {
            "Overblog\\GraphQLBundle\\Annotation\\": "Attribute"
          }
    }