Skip to content

CP-17268 debugbar - #2

Merged
niden merged 51 commits into
masterfrom
CP-17268-debugbar
Jul 12, 2026
Merged

CP-17268 debugbar#2
niden merged 51 commits into
masterfrom
CP-17268-debugbar

Conversation

@niden

@niden niden commented Jul 12, 2026

Copy link
Copy Markdown
Member
  • Migrated the Phalcon\Debug exception/error page component (Debug, Dump,
    ReportBuilder, HtmlRenderer, the Report value objects, Contracts, and
    the exception classes) out of the framework's Phalcon\Support\Debug, with its
    full test suite carried over green under PHPStan level max, plus the
    debug.css / debug.js page assets.
  • The web debug bar core: a Provider that boots the bar against an MVC
    Application purely through its EventsManager — no DI service and no
    container-specific wiring — and refuses to boot in blocked/production
    environments. It attaches a ResponseListener on
    application:beforeSendResponse that aggregates the collectors and injects the
    bar into HTML responses, backed by the DebugBar aggregator and the
    Renderer / Injector / BarOptions output pipeline.
  • A static Debug facade for manual instrumentation — Debug::info(),
    Debug::debug(), Debug::notice(), Debug::warning(), Debug::error(),
    Debug::message(), Debug::startMeasure() / Debug::stopMeasure(), and
    Debug::addException() — that no-ops when no bar is registered.
  • Eleven collectors — version, messages, time, exceptions, request,
    route, database, view, cache, config, and session. Streamed
    collectors (database, view, route, cache) read their data off the event source
    and never resolve services; snapshot collectors read injected objects
    (request, config) or PHP state (session). Durations are measured with
    hrtime().
  • Security\Redactor with two tiers — masking the values of sensitive keys and
    dropping configured "never shown" keys entirely — applied to the request,
    config, and session collectors, plus Security\AccessGate (IP allowlist and
    optional callback) restricting who receives the bar.
  • Per-collector enable/disable, asset, header, environment, access, and
    redaction (mask / hidden) configuration on the Provider. The bar ships
    under PHPStan level max with 100% line, method, and class coverage.

niden added 30 commits July 10, 2026 21:45
@niden niden self-assigned this Jul 12, 2026
@niden niden added the enhancement New feature or request label Jul 12, 2026
@github-actions

Copy link
Copy Markdown

Code Metrics Report

Coverage Test Execution Time
100.0% 1s

Code coverage of files in pull request scope (100.0%)

Details
Files Coverage
src/Debug.php 100.0%
src/Debug/Contracts/DebugThrowable.php 0.0%
src/Debug/Contracts/Renderer.php 0.0%
src/Debug/Contracts/TemplateAware.php 0.0%
src/Debug/Dump.php 100.0%
src/Debug/Exceptions/Exception.php 0.0%
src/Debug/Exceptions/RequestHalted.php 100.0%
src/Debug/Exceptions/RuntimeWarning.php 0.0%
src/Debug/Renderer/HtmlRenderer.php 100.0%
src/Debug/Report/BacktraceItem.php 100.0%
src/Debug/Report/ExceptionReport.php 100.0%
src/Debug/ReportBuilder.php 100.0%
src/Debug/Traits/TemplateAwareTrait.php 100.0%
src/DebugBar/BarOptions.php 100.0%
src/DebugBar/Collector/AbstractCollector.php 100.0%
src/DebugBar/Collector/CacheCollector.php 100.0%
src/DebugBar/Collector/ConfigCollector.php 100.0%
src/DebugBar/Collector/DatabaseCollector.php 100.0%
src/DebugBar/Collector/ExceptionsCollector.php 100.0%
src/DebugBar/Collector/FlattensToGrid.php 100.0%
src/DebugBar/Collector/MessagesCollector.php 100.0%
src/DebugBar/Collector/RequestCollector.php 100.0%
src/DebugBar/Collector/RouteCollector.php 100.0%
src/DebugBar/Collector/SessionCollector.php 100.0%
src/DebugBar/Collector/TimeCollector.php 100.0%
src/DebugBar/Collector/VersionCollector.php 100.0%
src/DebugBar/Collector/ViewCollector.php 100.0%
src/DebugBar/Contracts/Collector.php 0.0%
src/DebugBar/Contracts/DebugBarThrowable.php 0.0%
src/DebugBar/Contracts/ExceptionAware.php 0.0%
src/DebugBar/Contracts/MessageAware.php 0.0%
src/DebugBar/Contracts/Renderable.php 0.0%
src/DebugBar/Contracts/Subscriber.php 0.0%
src/DebugBar/Contracts/TimeAware.php 0.0%
src/DebugBar/Debug.php 100.0%
src/DebugBar/DebugBar.php 100.0%
src/DebugBar/Exceptions/CannotUseInProduction.php 0.0%
src/DebugBar/Exceptions/Exception.php 0.0%
src/DebugBar/Injector.php 100.0%
src/DebugBar/Provider.php 100.0%
src/DebugBar/Renderer.php 100.0%
src/DebugBar/ResponseListener.php 100.0%
src/DebugBar/Security/AccessGate.php 100.0%
src/DebugBar/Security/Redactor.php 100.0%
src/DebugBar/Version.php 100.0%

Reported by octocov

@niden
niden merged commit 9e734a8 into master Jul 12, 2026
16 checks passed
@niden
niden deleted the CP-17268-debugbar branch July 12, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant