Skip to content

Commit 1d4ede1

Browse files
committed
Note about --xdebug when Xdebug is enabled
1 parent 800e0c4 commit 1d4ede1

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎src/Command/CommandHelper.php‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ public static function begin(
100100
unset($xdebug);
101101
}
102102

103-
if ($allowXdebug && !XdebugHandler::isXdebugActive()) {
104-
$errorOutput->getStyle()->note('You are running with "--xdebug" enabled, but the Xdebug PHP extension is not active. The process will not halt at breakpoints.');
105-
} elseif (!$allowXdebug && XdebugHandler::isXdebugActive()) {
103+
if ($allowXdebug) {
104+
if (!XdebugHandler::isXdebugActive()) {
105+
$errorOutput->getStyle()->note('You are running with "--xdebug" enabled, but the Xdebug PHP extension is not active. The process will not halt at breakpoints.');
106+
} else {
107+
$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.");
108+
}
109+
} elseif (XdebugHandler::isXdebugActive()) {
106110
$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.');
107111
}
108112

0 commit comments

Comments
 (0)