← Back to Pull requests

fix(php): keep model namespace for allOf-wrapped $ref in items and params #25373

Open
unknown opened this pull request with 256 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 23, 2026 05:00 UTC
Author

Fixes #25354.

A single-member allOf around a model reference can lose the PHP namespace when used as an array item or query parameter. The generated declaration becomes \PhpModelError[] instead of \php\Model\Error[].

toAllOfName() returns a type declaration that already contains namespace separators. Passing it through toModelName() again removes those separators. This change resolves a single-member allOf through its member, or resolves an explicit x-all-of-name as a qualified model name.

The regression test covers array items, query parameters, and the named override.

Validation Correction

I checked the build and sample-generation box too early. The earlier sample run reused an older CLI JAR, so its zero-diff result did not verify this patch.

Fresh verification of commit 2760f0a8ca2c02aac8d13ea2cba08aec2460921b, in an isolated checkout with JDK 11.0.27:

  • Focused CLI reactor package build passed with tests skipped. The PHP generator class in the CLI JAR matches the class compiled by that build.

  • PHP unit package: 71 tests passed, with zero failures, errors, or skips. This includes the new namespace regression.

  • The rebuilt CLI generated the issue fixture with matching fully qualified wrapped and direct reference types. The named override remains CustomError.

  • PHP 8.1 syntax checks passed for the generated Result, DefaultApi, Error, and SortDir files.

  • All 15 PHP sample configurations regenerated successfully with zero tracked changes.

  • Documentation export for the 9 affected PHP generator names completed with zero tracked changes.
  • The full clean package build and all-language sample and documentation generation were not run. These are PHP-scoped results.

    PR Checklist

  • Read the contribution guidelines.

  • Complete the full build, sample, and documentation checklist. The PHP-scoped checks listed here do not establish that the full checklist passed.

  • Mention the PHP technical committee in the original description.
  • AI assisted the implementation and test execution.

    Diff: 256 lines (+192 / -64) across 3 files Reviewer: princejain756 Review duration: 55997m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.46) × (1 − Review Confidence (0.41)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 256 lines diff across 3 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    40%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.332
    Real PR Conversation Timeline
    1 comments
    "Review active on #25373"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 40.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 46.1% (MEDIUM) · Higher = larger blast radius
    46.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 40.9% · Lower = rushed or shallow review
    40.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.2% · Safe to merge
    27.2%