Skip to content

[PHP] Migrate kiota-abstractions-php off abandoned doctrine/annotations #7632

@luimen6

Description

@luimen6

Is your feature request related to a problem? Please describe the problem.

microsoft/kiota-abstractions-php (including latest 2.0.1) requires
doctrine/annotations via its composer.json. That package is marked as
abandoned on Packagist ("Package doctrine/annotations is abandoned, you
should avoid using it. No replacement was suggested."), which surfaces as
a warning on every composer install/update in any project that uses
microsoft/microsoft-graph (or any Kiota-generated PHP client).

doctrine/annotations parses PHPDoc annotations at runtime, which has
been obsoleted by native PHP 8 attributes. Staying on it long-term
exposes consumers to an unmaintained dependency for parsing request
metadata.

Client library/SDK language

PHP

Describe the solution you'd like

Replace the doc-block annotation usage in
src/RequestInformation.php (uses Doctrine\Common\Annotations\AnnotationReader
on lines 7/50/66) with native PHP 8.1+ attributes (#[QueryParameter]
etc.) and drop the doctrine/annotations require from composer.json.

The PHP generator in Kiota would need to emit attribute-based metadata
on request configuration classes instead of PHPDoc annotations, and
the abstractions package would use ReflectionClass::getAttributes()
to read them.

Additional context

  • composer.json still pins doctrine/annotations: ^1.13 || ^2.0
    as of microsoft/kiota-abstractions-php 2.0.1
  • microsoft/kiota-abstractions-php has issues disabled, so reporting
    here against the parent project
  • PHP 8.1 is already the minimum supported version of
    kiota-abstractions-php 2.x, so native attributes are available
    without raising requirements
  • doctrine/annotations was officially abandoned:
    https://github.com/doctrine/annotations (README notice)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions