Skip to content

Commit

Permalink
Note about --xdebug when Xdebug is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Apr 1, 2023
1 parent 800e0c4 commit 1d4ede1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Command/CommandHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,13 @@ public static function begin(
unset($xdebug);
}

if ($allowXdebug && !XdebugHandler::isXdebugActive()) {
$errorOutput->getStyle()->note('You are running with "--xdebug" enabled, but the Xdebug PHP extension is not active. The process will not halt at breakpoints.');
} elseif (!$allowXdebug && XdebugHandler::isXdebugActive()) {
if ($allowXdebug) {
if (!XdebugHandler::isXdebugActive()) {
$errorOutput->getStyle()->note('You are running with "--xdebug" enabled, but the Xdebug PHP extension is not active. The process will not halt at breakpoints.');
} else {
$errorOutput->getStyle()->note("You are running with \"--xdebug\" enabled, and the Xdebug PHP extension is active.\nThe process will halt at breakpoints, but PHPStan will run much slower.\nUse this only if you are debugging PHPStan itself or your custom extensions.");
}
} elseif (XdebugHandler::isXdebugActive()) {
$errorOutput->getStyle()->note('The Xdebug PHP extension is active, but "--xdebug" is not used. This may slow down performance and the process will not halt at breakpoints.');
}

Expand Down

0 comments on commit 1d4ede1

Please sign in to comment.