Repository navigation
Commit 1daa23a
Add the neon2attributes command migrating NEON service registrations to attributes
Deterministically converts services:/rules: entries into #[AutowiredService],
#[NonAutowiredService], #[RegisteredRule(level: 0)], #[RegisteredCollector] and
#[AutowiredParameter] on the classes, declares the edited directories in
attributeServicesDirectories, and leaves everything it cannot express (setup,
literal arguments, underivable tags, multi-registration, vendor classes) in
place with the reason reported. PHP edits are position-guided line insertions
(php-parser locates, plain text edits), NEON edits are order-mapped line
surgery that aborts on any layout it cannot map. Before keeping the changes
the command compiles the original and the converted configuration in fresh
subprocesses (the current process has the classes loaded without the new
attributes) and requires an identical tagged-services fingerprint, rolling
everything back otherwise.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vw4RxhEifXdnTPw57hG3Vw1 parent 4403454 commit 1daa23a
20 files changed
Lines changed: 1874 additions & 8 deletions
File tree
- bin
- src
- Command
- Neon2Attributes
- DependencyInjection/AttributeServices
- tests/PHPStan
- Command/Neon2Attributes
- data
- DependencyInjection/AttributeServices
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
0 commit comments