Repository navigation
feat(php): emit deprecation metadata in PHPDoc - #8367
RKS (rksharma-owg) wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused PHPDoc changes reuse sanitization, include regression coverage, and have no identified blocking issues.
0 open findings
What changed in this PR
Adds PHPDoc deprecation metadata to generated PHP SDK elements, addressing #2799 without changing generated signatures or executable code.
Changes:
- Emits deprecation reasons, versions and dates, including for elements without descriptions.
- Reuses comment sanitization and adds regression coverage.
- Documents PHP deprecation support in the changelog.
| File | Description |
|---|---|
| tests/Kiota.Builder.Tests/Writers/Php/DeprecationTests.cs | Tests deprecation output, controls, dates and sanitization. |
| src/Kiota.Builder/Writers/Php/PhpConventionService.cs | Formats and emits shared deprecation documentation. |
| src/Kiota.Builder/Writers/Php/CodePropertyWriter.cs | Adds property deprecation tags. |
| src/Kiota.Builder/Writers/Php/CodeMethodWriter.cs | Preserves documentation for deprecated methods without descriptions. |
| src/Kiota.Builder/Writers/Php/CodeEnumWriter.cs | Emits deprecated enum documentation. |
| CHANGELOG.md | Announces PHPDoc deprecation support. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
The failed Notion/PHP job reports |
|
Conflicts have been resolved. A maintainer will take a look shortly. |
Fixes #2799.
The PHP writers omit deprecation metadata, including on elements without descriptions. Emit
@deprecatedthrough existing documentation writers, preserving the reason, version and dates and reusing comment sanitization. Property accessors receive their propagated metadata. PHP enum descriptions and external references use the shared documentation writer regardless of deprecation, as requested in review. Generated signatures and executable code remain unchanged.Merged current main
31c61e46aa65d9152e2f03426793d4705aceccfdand resolved the changelog conflict by retaining both the PHP deprecation entry and upstream additions. The PHP implementation and regression-test diff is unchanged from the approved revision. Validated source:fe32c35426cc4026c410be3f3bda421177f979f8.Notion/PHP still executes and fails PHPStan's documented
array<mixed>versusarray<string>|nullcheck (microsoft/kiota-php#117). Other suppressed failures match the documented Stripe, Graph Beta, Notion/TypeScript and Twitter ordering limitations. PHPStan, suppressions and upstream CI are unchanged. Fork harnesses verify the exact source and target SHAs and remain outside this PR. Upstream approval-held checks remain separate from completed fork validation.