You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[NFR]: Extract a neutral boot core from Provider #40
Provider holds all the boot logic and requires a Phalcon\Mvc\Application. Move the logic that does not need MVC or DI to a new class. MVC behavior does not change.
Current coupling
The constructor requires Phalcon\Mvc\Application (src/DebugBar/Provider.php:105).
boot() calls getDI() and getEventsManager() (src/DebugBar/Provider.php:161, :176).
buildCollectors(), resolveConfig() and resolveRequest() take a DiInterface (src/DebugBar/Provider.php:221, :331, :359).
Proposed direction
Add a new class with no Phalcon\Mvc or Phalcon\Di imports. It takes:
?Phalcon\Events\ManagerInterface
?Phalcon\Http\RequestInterface
?Phalcon\Config\ConfigInterface
the config array
optional history parts, so that Provider can pass them
Move these to the new class: config parsing, the environment and env.strict checks, collector creation, Debug::setBar() and collector subscription.
Provider keeps its constructor, boot(), isAllowed(), registerHistory() and the application:beforeSendResponse attachment. registerHistory() stays because it needs DI.
Notes
Keep the current MVC result for ConfigCollector (src/DebugBar/Provider.php:269): a DI with no config service creates the collector with a null config.
Update the provider_config type in DebugBarTypes if the config changes.
Acceptance
A test boots the new class with no Phalcon\Mvc\Application and no Phalcon\Di\DiInterface.
The 30 existing ProviderTest tests pass with the same expected results.
Tests pass with full coverage. phpcs and phpstan pass.
Activity
niden commentedon Nov 3, 2026
Resolved in #50