Skip to content

Commit

Permalink
Some renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 24, 2020
1 parent 90bda81 commit 6a7dbde
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Command/FixerApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function log(string $message): void
if ($exitCode === 0) {
return;
}
$output->writeln(sprintf('<fg=red>Fixer process exited with code %d.</>', $exitCode));
$output->writeln(sprintf('<fg=red>PHPStan Pro process exited with code %d.</>', $exitCode));
});

$loop->run();
Expand All @@ -282,7 +282,7 @@ private function getFixerProcess(OutputInterface $output, int $serverPort): Proc
$this->downloadPhar($output, $pharPath, $infoPath);
} catch (\RuntimeException $e) {
if (!file_exists($pharPath)) {
$output->writeln('<fg=red>Could not download the fixer executable.</>');
$output->writeln('<fg=red>Could not download the PHPStan Pro executable.</>');
$output->writeln($e->getMessage());

throw new \PHPStan\Command\FixerProcessException();
Expand All @@ -297,15 +297,15 @@ private function getFixerProcess(OutputInterface $output, int $serverPort): Proc
} catch (\Throwable $e) {
@unlink($pharPath);
@unlink($infoPath);
$output->writeln('<fg=red>Fixer PHAR signature is corrupted.</>');
$output->writeln('<fg=red>PHPStan Pro PHAR signature is corrupted.</>');

throw new \PHPStan\Command\FixerProcessException();
}

if ($phar->getSignature()['hash_type'] !== 'OpenSSL') {
@unlink($pharPath);
@unlink($infoPath);
$output->writeln('<fg=red>Fixer PHAR signature is corrupted.</>');
$output->writeln('<fg=red>PHPStan Pro PHAR signature is corrupted.</>');

throw new \PHPStan\Command\FixerProcessException();
}
Expand All @@ -332,7 +332,7 @@ private function downloadPhar(
return;
}

$output->writeln('<fg=green>Checking if there\'s a new PHPStan Fixer release...</>');
$output->writeln('<fg=green>Checking if there\'s a new PHPStan Pro release...</>');
}

$loop = new StreamSelectLoop();
Expand All @@ -353,11 +353,11 @@ private function downloadPhar(
$latestInfo = Json::decode((string) await($client->get('https://fixer-download-api.phpstan.com/latest'), $loop, 5.0)->getBody(), Json::FORCE_ARRAY);
if ($currentVersion !== null && $latestInfo['version'] === $currentVersion) {
$this->writeInfoFile($infoPath, $latestInfo['version']);
$output->writeln('<fg=green>You\'re running the latest PHPStan Fixer!</>');
$output->writeln('<fg=green>You\'re running the latest PHPStan Pro!</>');
return;
}

$output->writeln('<fg=green>Downloading the latest PHPStan Fixer...</>');
$output->writeln('<fg=green>Downloading the latest PHPStan Pro...</>');

$progressBar = new ProgressBar($output);
$client->requestStreaming('GET', $latestInfo['url'])->then(static function (ResponseInterface $response) use ($loop, $pharPath, $progressBar): void {
Expand Down

0 comments on commit 6a7dbde

Please sign in to comment.