Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

RFC: remove AspectKernel::getInstance() service-locator coupling from runtime classes

Aperta
#637 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

Start from the singleton at src/Core/AspectKernel.php:74,94-101 and the five call sites named: InterceptorInjector.php:31,137-141, AbstractInterceptor.php:145, PointcutReference.php:61, FilterInjectorTransformer.php:88, MagicConstantTransformer.php:86. Read how generated proxies and cached files call the static entry points before sketching the proposed Go\Core\Runtime holder. This is an RFC that needs design discussion first, so done means an agreed design that keeps the woven-code static surface stable across a cache warm.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Enhancement To Be Discussed

Problem

AspectKernel is a classic singleton (protected static ?self $instance, final protected function __construct() — src/Core/AspectKernel.php:74,94-101), and five runtime classes statically pull the container out of it:

  • src/Aop/Framework/InterceptorInjector.php:31,137-141
  • src/Aop/Framework/AbstractInterceptor.php:145
  • src/Aop/Pointcut/PointcutReference.php:61
  • src/Instrument/Transformer/FilterInjectorTransformer.php:88
  • src/Instrument/Transformer/MagicConstantTransformer.php:86

This blocks parallel kernels, embedding (e.g. a Symfony bundle with its own lifecycle), and test isolation.

Proposed design (for discussion)

  • Introduce an explicit Go\Core\Runtime holder bound once at kernel boot; woven code and runtime classes receive it (or the container) by injection instead of AspectKernel::getInstance()->getContainer().
  • Keep getInstance() as a thin deprecated BC shim delegating to the bound runtime.
  • Decide the woven-code contract carefully: generated proxies reference these entry points by name, so the static surface that cached files call must stay stable across a cache warm.

Effort L, risk med-high (public API + woven code shape). Needs design discussion before implementation. Related: the advisor-cache RFC removes two of these call sites on its own.

Lingua principale
PHP
Stelle
1.7k
Fork
166
Merge medio
19h 39m
PR unite (30g)
48

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di goaop/framework

Tutte le issue di goaop/framework

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.