Skip to content

Report attribute refs to a no-namespace schema as unqualified - #67

Merged
veewee merged 1 commit into
php-soap:mainfrom
veewee:fix-no-namespace-attribute-refs
Oct 16, 2026
Merged

veewee merged 1 commit into
php-soap:mainfrom
veewee:fix-no-namespace-attribute-refs

Conversation

@veewee

@veewee veewee commented Oct 16, 2026 •

Copy link
Copy Markdown
Member
Q A
Type bugfix
BC Break no
Fixed issues

Follow-up to #66, from the CodeRabbit comment there. #66 reported every attribute declared through ref as qualified. A global attribute lives in the target namespace of the schema that declares it, and when that schema has no targetNamespace the attribute has no namespace at all, so it is unqualified.

A ref is now qualified only when the schema of the referenced attribute has a target namespace. Local attributes keep following form and attributeFormDefault.

A chameleon include, a schema without targetNamespace included into one that has one, still comes back qualified. xsd-reader merges the included declarations into the including schema, so they take its namespace, which is what the spec asks for.

One xsd-reader quirk stays out of scope. It treats an xsd:import without a namespace attribute like a chameleon include and merges the imported declarations into the importing schema's namespace. This fix reports whatever namespace xsd-reader assigns.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected how referenced global attributes are identified as qualified. Attributes in schemas without a target namespace are now recognized as unqualified, while attributes in schemas with a target namespace remain qualified.
    • Local attributes continue to follow their existing qualification settings, preserving their established behavior.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c1ca637c-c1b6-424c-995d-e2cf512486be
📥 Commits

Reviewing files that changed from the base of the PR and between 7839e29 and 2a53d45.

📒 Files selected for processing: 2
  • src/Metadata/Converter/Types/Configurator/AttributeSingleConfigurator.php
  • tests/Unit/Metadata/Coverter/Types/Configurator/AttributeQualificationTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

Attribute references are now qualified based on the referenced attribute’s schema target namespace. A regression test checks the result for a referenced global attribute in a schema without a target namespace.

Changes: Attribute qualification

Layer / File(s) Summary
Qualification rule and regression test
src/Metadata/Converter/Types/Configurator/AttributeSingleConfigurator.php, tests/Unit/Metadata/Coverter/Types/Configurator/AttributeQualificationTest.php
Referenced attributes are qualified only when their schema has a non-empty target namespace. Local attributes continue to use isQualified(). The test checks that a referenced global attribute in a schema without a target namespace is not qualified.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 2a53d

The qualification change has no identified issue requiring correction before merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main bugfix: attribute references to schemas without a target namespace are reported as unqualified.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@veewee
veewee merged commit 40566ac into php-soap:main Oct 16, 2026
11 checks passed
@veewee
veewee deleted the fix-no-namespace-attribute-refs branch October 16, 2026 08:49
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.

1 participant