Skip to content

Extract high-value style boundary policy#515

Merged
chubes4 merged 1 commit into
trunkfrom
refactor-php-transformer-patterns
Jul 6, 2026
Merged

Extract high-value style boundary policy#515
chubes4 merged 1 commit into
trunkfrom
refactor-php-transformer-patterns

Conversation

@chubes4

@chubes4 chubes4 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extract high-value static CSS matching boundary recognition from StyleResolutionTrait into HighValueStyleBoundaryPolicy.
  • Keep StyleResolutionTrait's existing private entrypoint as a delegate so behavior stays unchanged.
  • Leave fixtures and CHANGELOG.md untouched.

Root cause / technical debt addressed

HtmlTransformer's style-resolution path still carried generic pattern-recognition policy inline in the trait. That made future additions to static CSS matching boundaries a pile-on conditional risk. This PR gives that boundary decision a dedicated policy class without changing the conversion contract.

Testing

  • composer test (php-transformer)
  • Includes canonical contracts, unit tests, parity fixtures (228 fixtures), and packaging proof.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI GPT-5.5 via OpenCode
  • Used for: Inspected transformer structure, extracted the style-boundary policy, ran verification, and drafted this PR description.

@chubes4 chubes4 force-pushed the refactor-php-transformer-patterns branch from bf6f395 to eb83fff Compare July 6, 2026 19:33
@chubes4 chubes4 merged commit 48f9827 into trunk Jul 6, 2026
@chubes4 chubes4 deleted the refactor-php-transformer-patterns branch July 6, 2026 19:34
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