microsoft / microsoft/kiota-php

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

Open
#99 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

php status:waiting-for-triage type:feature
Dominant language
PHP
Stars
8
Forks
10
Avg merge
10h 16m
Merged PRs (30d)
3

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/RequestInformation.php and composer.json to trace the AnnotationReader usage and the doctrine/annotations requirement. Then inspect the PHP generator's request configuration output and determine how attributes should replace the current annotations. Done means generated metadata is read through PHP 8.1 attributes and the abandoned dependency is removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.