Skip to content
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

Annotations should be deprecated #1173

Open
Vincz opened this issue Mar 29, 2024 · 3 comments
Open

Annotations should be deprecated #1173

Vincz opened this issue Mar 29, 2024 · 3 comments
Labels
dependencies Pull requests that update a dependency file

Comments

@Vincz
Copy link
Collaborator

Vincz commented Mar 29, 2024

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 Vincz added the dependencies Pull requests that update a dependency file label Mar 29, 2024
@Vincz
Copy link
Collaborator Author

Vincz commented Mar 30, 2024

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
Copy link
Collaborator Author

Vincz commented Mar 31, 2024

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
Copy link
Collaborator Author

Vincz commented Mar 31, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

1 participant