graphqlite icon indicating copy to clipboard operation
graphqlite copied to clipboard

RFC: consider renaming "Annotations" to "Attributes"

Open andrew-demb opened this issue 6 months ago • 2 comments

Initially, the term "annotations" was used due to the lack of native PHP support for meta annotations over methods and properties.

After PHP 7, PHP introduced attributes - a native instrument available via PHP reflection to add meta information.

GraphQLite dropped support for Doctrine annotations after https://github.com/thecodingmachine/graphqlite/pull/677 (GraphQLite 7)

What about changing naming used everywhere - use attribute instead of annotation?

Examples:

  • https://github.com/thecodingmachine/graphqlite/blob/54034734d962f1d73068dedb71895aa90f7d3f07/src/Annotations/MiddlewareAnnotationInterface.php#L7-L10
  • https://github.com/thecodingmachine/graphqlite/blob/54034734d962f1d73068dedb71895aa90f7d3f07/src/Annotations/Cost.php#L5

andrew-demb avatar Jul 08 '25 08:07 andrew-demb

I agree - PR is welcomed.

oojacoboo avatar Jul 08 '25 18:07 oojacoboo

Also dropping the array $attributes first parameter of a lot of the attributes - would be nice :)

oprypkhantc avatar Sep 05 '25 12:09 oprypkhantc