Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

RFC: decompose WeavingTransformer into TokenStreamEditor + TraitConverter

Open
#638 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
backend

Research direction

The target is src/Instrument/Transformer/WeavingTransformer.php (1037 lines, 20 methods); read it whole and map which methods belong to token surgery, class/enum→trait conversion, and orchestration. The safety net is the fixture suite under tests/Core/Instrument/Transformer/_files/*, which must stay byte-for-byte identical. Done means the two new services are extracted, WeavingTransformer only matches advisors → converts → writes cache, and the fixtures still pass unchanged — but cut lines are explicitly still under discussion, so the first step is agreeing on the boundaries, not editing.

Written by the indexing model from the issue text.

Description

Enhancement To Be Discussed

Problem

src/Instrument/Transformer/WeavingTransformer.php is 1037 lines / 20 methods owning: advisor-matching orchestration, class→trait conversion (:255), enum→trait conversion (:454), #[\Override] stripping (:543), attribute-group stripping (:345), promoted-property demotion (:766), constructor-assignment injection (:830), token-blanking helpers (:386, :404, :894, :935), function proxying (:958), and cache writing (~:996). It is the highest-churn, highest-risk file in the repo — most recent audit commits touched it.

Proposed decomposition (for discussion)

  • TokenStreamEditor: the token surgery helpers (blanking, splicing, line-preserving edits) as a directly unit-testable service.
  • TraitConverter: class→trait and enum→trait conversion, including #[\Override]/attribute handling and promoted-property demotion.
  • WeavingTransformer keeps orchestration: match advisors → convert → write cache.

Pure refactor; the fixture suite (tests/Core/Instrument/Transformer/_files/*) must stay byte-for-byte green. Effort L, risk medium. Needs discussion on cut lines before implementation.

Dominant language
PHP
Stars
1.7k
Forks
166
Avg merge
11h 20m
Merged PRs (30d)
37

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from goaop/framework

All issues in goaop/framework

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.