microsoft / microsoft/kiota-php
[PHP] Migrate kiota-abstractions-php off abandoned doctrine/annotations
Nobody has claimed this yet.
- 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 ofmicrosoft/kiota-abstractions-php2.0.1 microsoft/kiota-abstractions-phphas 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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