Skip to content

Commit 4314be3

Browse files
committed
CompileCommand - do not run Box
1 parent 95e5932 commit 4314be3

File tree

10 files changed

+6
-151
lines changed

10 files changed

+6
-151
lines changed

.github/workflows/phar.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ jobs:
4646
working-directory: "compiler"
4747
run: "../bin/phpstan analyse -l 8 src tests"
4848

49-
- name: "Compiler PHAR"
49+
- name: "Prepare for PHAR compilation"
5050
working-directory: "compiler"
5151
run: "php bin/compile"
5252

53+
- name: "Compile PHAR"
54+
working-directory: "compiler/build"
55+
run: "php box.phar compile --no-parallel"
56+
5357
- name: "Run PHAR"
5458
run: "./tmp/phpstan.phar list"
5559

compiler/bin/compile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33

44
use PHPStan\Compiler\Console\CompileCommand;
55
use PHPStan\Compiler\Filesystem\SymfonyFilesystem;
6-
use PHPStan\Compiler\Process\DefaultProcessFactory;
76
use Symfony\Component\Console\Application;
87

98
require_once __DIR__ . '/../vendor/autoload.php';
109

1110
$compileCommand = new CompileCommand(
1211
new SymfonyFilesystem(new \Symfony\Component\Filesystem\Filesystem()),
13-
new DefaultProcessFactory(),
14-
__DIR__ . '/../build',
1512
realpath(__DIR__ . '/../..')
1613
);
1714

compiler/src/Console/CompileCommand.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Exception;
66
use PHPStan\Compiler\Filesystem\Filesystem;
7-
use PHPStan\Compiler\Process\ProcessFactory;
87
use PHPStan\ShouldNotHappenException;
98
use Symfony\Component\Console\Command\Command;
109
use Symfony\Component\Console\Input\InputInterface;
@@ -36,8 +35,6 @@ final class CompileCommand extends Command
3635

3736
public function __construct(
3837
private Filesystem $filesystem,
39-
private ProcessFactory $processFactory,
40-
private string $dataDir,
4138
private string $buildDir,
4239
)
4340
{
@@ -52,17 +49,12 @@ protected function configure(): void
5249

5350
protected function execute(InputInterface $input, OutputInterface $output): int
5451
{
55-
$this->processFactory->setOutput($output);
56-
5752
$this->buildPreloadScript();
5853
$this->deleteUnnecessaryVendorCode();
5954
$this->fixComposerJson($this->buildDir);
6055
$this->renamePhpStormStubs();
6156
$this->renamePhp8Stubs();
6257
$this->transformSource();
63-
64-
$this->processFactory->create(['php', 'box.phar', 'compile', '--no-parallel'], $this->dataDir);
65-
6658
return 0;
6759
}
6860

compiler/src/Process/DefaultProcessFactory.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

compiler/src/Process/Process.php

Lines changed: 0 additions & 13 deletions
This file was deleted.

compiler/src/Process/ProcessFactory.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

compiler/src/Process/SymfonyProcess.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

compiler/tests/.phpunit.result.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
C:37:"PHPUnit\Runner\DefaultTestResultCache":636:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:8:{s:56:"PHPStan\Compiler\Console\CompileCommandTest::testCommand";d:0.053;s:61:"PHPStan\Compiler\Filesystem\SymfonyFilesystemTest::testExists";d:0.01;s:61:"PHPStan\Compiler\Filesystem\SymfonyFilesystemTest::testRemove";d:0;s:60:"PHPStan\Compiler\Filesystem\SymfonyFilesystemTest::testMkdir";d:0;s:59:"PHPStan\Compiler\Filesystem\SymfonyFilesystemTest::testRead";d:0;s:60:"PHPStan\Compiler\Filesystem\SymfonyFilesystemTest::testWrite";d:0.008;s:62:"PHPStan\Compiler\Process\DefaultProcessFactoryTest::testCreate";d:0.058;s:59:"PHPStan\Compiler\Process\SymfonyProcessTest::testGetProcess";d:0.01;}}}
1+
{"version":1,"defects":[],"times":{"PHPStan\\Compiler\\Filesystem\\SymfonyFilesystemTest::testExists":0.014,"PHPStan\\Compiler\\Filesystem\\SymfonyFilesystemTest::testRemove":0,"PHPStan\\Compiler\\Filesystem\\SymfonyFilesystemTest::testMkdir":0,"PHPStan\\Compiler\\Filesystem\\SymfonyFilesystemTest::testRead":0,"PHPStan\\Compiler\\Filesystem\\SymfonyFilesystemTest::testWrite":0}}

compiler/tests/Process/DefaultProcessFactoryTest.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

compiler/tests/Process/SymfonyProcessTest.php

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)