Skip to content

Commit 4883ea4

Browse files
committed
fix warning in e.g. app tests when global is not present
1 parent 0bb4002 commit 4883ea4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ToolbarService.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,13 @@ public function registry(): PanelRegistry
102102
*/
103103
public function isEnabled(): bool
104104
{
105-
if (defined('PHPUNIT_COMPOSER_INSTALL') && !$GLOBALS['FORCE_DEBUGKIT_TOOLBAR']) {
105+
if (!isset($GLOBALS['FORCE_DEBUGKIT_TOOLBAR'])) {
106+
$GLOBALS['FORCE_DEBUGKIT_TOOLBAR'] = false;
107+
}
108+
if (
109+
defined('PHPUNIT_COMPOSER_INSTALL') &&
110+
!$GLOBALS['FORCE_DEBUGKIT_TOOLBAR']
111+
) {
106112
return false;
107113
}
108114
$enabled = (bool)Configure::read('debug')

0 commit comments

Comments
 (0)