|
3 | 3 | namespace PHPStan\Command; |
4 | 4 |
|
5 | 5 | use Composer\Semver\Semver; |
6 | | -use Composer\XdebugHandler\XdebugHandler; |
7 | 6 | use Nette\DI\Helpers; |
8 | 7 | use Nette\DI\InvalidConfigurationException; |
9 | 8 | use Nette\DI\ServiceCreationException; |
|
32 | 31 | use PHPStan\Internal\DirectoryCreator; |
33 | 32 | use PHPStan\Internal\DirectoryCreatorException; |
34 | 33 | use PHPStan\Process\ForkedChildCrashReporter; |
| 34 | +use PHPStan\Process\ProcessRestarter; |
35 | 35 | use PHPStan\ShouldNotHappenException; |
36 | 36 | use ReflectionClass; |
37 | 37 | use Symfony\Component\Console\Input\InputInterface; |
@@ -104,22 +104,22 @@ public static function begin( |
104 | 104 | $errorOutput = new SymfonyOutput($symfonyErrorOutput, new SymfonyStyle(new ErrorsConsoleStyle($input, $symfonyErrorOutput))); |
105 | 105 |
|
106 | 106 | if (!$allowXdebug) { |
107 | | - $xdebug = new XdebugHandler('phpstan'); |
| 107 | + $xdebug = new ProcessRestarter('phpstan'); |
108 | 108 | $xdebug->setPersistent(); |
109 | 109 | $xdebug->check(); |
110 | 110 | unset($xdebug); |
111 | 111 | } |
112 | 112 |
|
113 | 113 | if ($allowXdebug) { |
114 | | - if (!XdebugHandler::isXdebugActive()) { |
| 114 | + if (!ProcessRestarter::isXdebugActive()) { |
115 | 115 | $errorOutput->getStyle()->note('You are running with "--xdebug" enabled, but the Xdebug PHP extension is not active. The process will not halt at breakpoints.'); |
116 | 116 | } else { |
117 | 117 | $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."); |
118 | 118 | } |
119 | | - } elseif (XdebugHandler::isXdebugActive()) { |
| 119 | + } elseif (ProcessRestarter::isXdebugActive()) { |
120 | 120 | $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.'); |
121 | 121 | } elseif ($debugEnabled) { |
122 | | - $v = XdebugHandler::getSkippedVersion(); |
| 122 | + $v = ProcessRestarter::getSkippedVersion(); |
123 | 123 | if ($v !== '') { |
124 | 124 | $errorOutput->getStyle()->note( |
125 | 125 | "The Xdebug PHP extension is active, but \"--xdebug\" is not used.\n" . |
|
0 commit comments