Skip to content

feat(php): emit deprecation metadata in PHPDoc - #8367

Open
RKS (rksharma-owg) wants to merge 6 commits into
microsoft:mainfrom
rksharma-owg:codex/php-deprecation
Open

RKS (rksharma-owg) wants to merge 6 commits into
microsoft:mainfrom
rksharma-owg:codex/php-deprecation

Conversation

@rksharma-owg

@rksharma-owg RKS (rksharma-owg) commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2799.

The PHP writers omit deprecation metadata, including on elements without descriptions. Emit @deprecated through 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 31c61e46aa65d9152e2f03426793d4705aceccfd and 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.

  • Local .NET 10.0.401: restore, formatting and full solution build pass with zero build warnings/errors. Local and hosted full-suite/platform/PHP checks: 3,073 passed, three existing skips. Production coverage uses the current upstream assembly filters. Five platform binaries, VS Code tests/package builds, and all five generated PHP fixture syntax checks pass; metadata assertions cover models, enums, accessors and operations.
  • CodeQL, surface area and translations pass.
  • Integration: 161 cells pass; seven execute and fail under existing documented upstream suppressions. Idempotency: 110 cells pass; two execute and fail under existing suppressions. All 280 matrix cells execute; none are skipped. The executed failures are not counted as passes.

Notion/PHP still executes and fails PHPStan's documented array<mixed> versus array<string>|null check (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.

@rksharma-owg
RKS (rksharma-owg) requested a review from a team as a code owner October 8, 2026 18:21
Copilot AI balanced review requested due to automatic review settings October 8, 2026 18:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

Comment thread src/Kiota.Builder/Writers/Php/CodeEnumWriter.cs Outdated
Copilot AI balanced review requested due to automatic review settings October 8, 2026 19:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation consistently emits sanitized metadata and includes focused regression coverage for all affected PHP elements.

0 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 8, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The implementation is consistent across PHP writer paths and includes focused regression coverage.

0 open findings

🧠 Review effort: Balanced

@rksharma-owg

Copy link
Copy Markdown
Contributor Author

The failed Notion/PHP job reports StringOrStringArray::setString() receiving array<mixed> where PHPStan expects array<string>|null. This is the collection-nullability issue tracked in microsoft/kiota-php#117; main now includes the scoped workaround from #8377. The same error appeared on both #8347 and #8367. I have not changed their implementations or weakened PHPStan to work around it.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 18:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused documentation changes preserve executable behavior, include regression coverage and have no unresolved findings.

0 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 23, 2026 01:46
@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused PHPDoc changes reuse existing sanitization, preserve executable behavior and include regression coverage, with no blocking issues identified.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add deprecation support to PHP

3 participants