Skip to content

Align SoapHeader(s) configurator type with namespaced_element#17

Merged
veewee merged 1 commit into
php-soap:mainfrom
veewee:fix/soap-header-configurator-element-type
Jun 26, 2026
Merged

Align SoapHeader(s) configurator type with namespaced_element#17
veewee merged 1 commit into
php-soap:mainfrom
veewee:fix/soap-header-configurator-element-type

Conversation

@veewee

@veewee veewee commented Jun 26, 2026

Copy link
Copy Markdown
Member

What

Change the $configurators annotation in SoapHeader and SoapHeaders from list<callable(Node): Element> to list<callable(Element): Element>.

Why

Both builders forward $configurators straight into veewee's namespaced_element(...), whose signature is list<callable(Element): Element>. The previous callable(Node): Element annotation diverged from the delegation target, so under strict psalm passing value() (which is callable(Element): Element) to SoapHeader was rejected — even though the exact same value() works when passed directly to namespaced_element. php-soap's own README example tripped on this.

Matching the delegated signature fixes it. A short docblock note records that the Element signature mirrors namespaced_element().

Verification

  • vendor/bin/psalm (errorLevel 1): No errors found, 100% type inference.
  • vendor/bin/phpunit: OK — 26 tests, 30 assertions.

The configurators are forwarded to veewee's namespaced_element(), whose
signature is list<callable(Element): Element>. The previous
callable(Node): Element annotation made strict psalm reject value()
(callable(Element): Element) when passed to SoapHeader, even though it
works directly on namespaced_element. Match the delegated signature.
@veewee veewee merged commit 5bb2104 into php-soap:main Jun 26, 2026
6 checks passed
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