diff --git a/.github/workflows/run-integration.yml b/.github/workflows/run-integration.yml index 07e2e3e..f6d6ccc 100644 --- a/.github/workflows/run-integration.yml +++ b/.github/workflows/run-integration.yml @@ -7,8 +7,6 @@ on: pull_request: branches: - "*" - schedule: - - cron: '0 0 * * *' jobs: php-tests: @@ -19,7 +17,7 @@ jobs: strategy: matrix: - php: [8.5, 8.4, 8.3, 8.2, 8.1] + php: [8.5, 8.4, 8.3, 8.2] name: PHP${{ matrix.php }} diff --git a/.github/workflows/run-screenshots.yml b/.github/workflows/run-screenshots.yml index 635ac7b..4f0f162 100644 --- a/.github/workflows/run-screenshots.yml +++ b/.github/workflows/run-screenshots.yml @@ -7,8 +7,6 @@ on: pull_request: branches: - "*" - schedule: - - cron: '0 0 * * *' jobs: php-tests: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9dfeb4d..66517be 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -7,8 +7,6 @@ on: pull_request: branches: - "*" - schedule: - - cron: '0 0 * * *' jobs: php-tests: @@ -19,7 +17,7 @@ jobs: strategy: matrix: - php: [8.5, 8.4, 8.3, 8.2, 8.1] + php: [8.5, 8.4, 8.3, 8.2] name: PHP${{ matrix.php }} diff --git a/composer.json b/composer.json index 34f8cdf..072ddf7 100644 --- a/composer.json +++ b/composer.json @@ -17,15 +17,15 @@ } ], "require": { - "php": "^8.1", - "php-debugbar/php-debugbar": "^2.0", + "php": "^8.2", + "php-debugbar/php-debugbar": "^3", "doctrine/orm": "^2.10|^3.0", - "doctrine/dbal": "^3.6|^4", - "symfony/var-exporter": "^6.4|^7", - "symfony/dom-crawler": "^6.4|^7", - "symfony/browser-kit": "^6.4|^7" + "doctrine/dbal": "^3.6|^4" }, "require-dev": { + "symfony/var-exporter": "^6.4|^7", + "symfony/dom-crawler": "^6.4|^7", + "symfony/browser-kit": "^6.4|^7", "phpunit/phpunit": "^10", "symfony/panther": "^1|^2.1", "dbrekelmans/bdi": "^1" @@ -55,7 +55,8 @@ }, "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } - } + }, + "minimum-stability": "beta" } diff --git a/demo/assets.php b/demo/assets.php new file mode 100644 index 0000000..4867e40 --- /dev/null +++ b/demo/assets.php @@ -0,0 +1,14 @@ +handle($_GET); diff --git a/demo/bootstrap.php b/demo/bootstrap.php index b7031ba..4fc5e1c 100644 --- a/demo/bootstrap.php +++ b/demo/bootstrap.php @@ -9,12 +9,12 @@ $debugbar = new StandardDebugBar(); $debugbarRenderer = $debugbar->getJavascriptRenderer() - ->setBaseUrl('../src/DebugBar/Resources') + ->setAssetHandlerUrl('assets.php') ->setAjaxHandlerEnableTab(true) ->setHideEmptyTabs(true) - ->setEnableJqueryNoConflict(false) ->setTheme($_GET['theme'] ?? 'auto'); + // // create a writable profiles folder in the demo directory to uncomment the following lines // @@ -27,24 +27,26 @@ function render_demo_page(?Closure $callback = null) global $debugbarRenderer; ?> - - renderHead() ?> - - + }); +

DebugBar Demo

DebugBar at the bottom of the page

renderHead(); echo $debugbarRenderer->render(); ?> diff --git a/src/DoctrineCollector.php b/src/DoctrineCollector.php index 9018af0..621363c 100644 --- a/src/DoctrineCollector.php +++ b/src/DoctrineCollector.php @@ -57,7 +57,7 @@ public function setDebugStack(DebugBarSQLMiddleware $debugStack): void * * @param bool $enabled */ - public function setDurationBackground($enabled) + public function setDurationBackground(bool $enabled): void { $this->durationBackground = $enabled; } @@ -67,7 +67,7 @@ public function setDurationBackground($enabled) * * @param int|float $threshold miliseconds value */ - public function setSlowThreshold($threshold) + public function setSlowThreshold(int|float $threshold): void { $this->slowThreshold = $threshold / 1000; } @@ -75,7 +75,7 @@ public function setSlowThreshold($threshold) /** * @return array */ - public function collect() + public function collect(): array { $queries = array(); $nb_statements = 0; @@ -85,7 +85,7 @@ public function collect() 'sql' => $q['sql'], 'params' => (object) $this->getParameters($q['params'] ?? []), 'duration' => $q['executionMS'], - 'duration_str' => $this->formatDuration($q['executionMS']), + 'duration_str' => $this->getDataFormatter()->formatDuration($q['executionMS']), 'type' => $q['type'] ?? null, 'slow' => $this->slowThreshold && $this->slowThreshold <= $q['executionMS'], ); @@ -114,7 +114,7 @@ public function collect() 'count' => count($queries), 'nb_statements' => $nb_statements, 'accumulated_duration' => $totalExecTime, - 'accumulated_duration_str' => $this->formatDuration($totalExecTime), + 'accumulated_duration_str' => $this->getDataFormatter()->formatDuration($totalExecTime), 'statements' => $queries ); } @@ -145,7 +145,7 @@ public function getParameters($params) : array /** * @return string */ - public function getName() + public function getName(): string { return 'doctrine'; } @@ -153,7 +153,7 @@ public function getName() /** * @return array */ - public function getWidgets() + public function getWidgets(): array { return array( "database" => array( @@ -172,7 +172,7 @@ public function getWidgets() /** * @return array */ - public function getAssets() + public function getAssets(): array { return array( 'css' => 'widgets/sqlqueries/widget.css',