Skip to content

Cache type iso in AttributeValueEncoder#55

Merged
veewee merged 1 commit intophp-soap:mainfrom
veewee:feature/attribute-value-encoder-iso-cache
Mar 26, 2026
Merged

Cache type iso in AttributeValueEncoder#55
veewee merged 1 commit intophp-soap:mainfrom
veewee:feature/attribute-value-encoder-iso-cache

Conversation

@veewee
Copy link
Copy Markdown
Member

@veewee veewee commented Mar 26, 2026

Summary

Captures $this->typeEncoder->iso($context) once in iso() and passes the cached iso to the private to() and from() methods. Previously the iso was rebuilt up to 4 times per encode/decode cycle (fixed value check, encode, decode value, decode default/fixed fallback).

Impact

<1% (attributes are less common than elements). Same pattern as #52 and #53: capture the iso eagerly, pass it to private methods.

Test plan

  • Full test suite passes (549 tests)
  • Psalm clean
  • CS fixer clean

Captures $this->typeEncoder->iso($context) once in iso() and passes
it to the private to() and from() methods. Previously called up to
4 times per encode/decode (fixed value check, encode, decode, default).
@veewee veewee merged commit 334cc15 into php-soap:main Mar 26, 2026
16 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