GraphQLBundle icon indicating copy to clipboard operation
GraphQLBundle copied to clipboard

Annotations should be deprecated

Open Vincz opened this issue 1 year ago • 3 comments

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 avatar Mar 29 '24 16:03 Vincz

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 avatar Mar 30 '24 17:03 Vincz

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 avatar Mar 31 '24 08:03 Vincz

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

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

Vincz avatar Mar 31 '24 08:03 Vincz