Skip to content

Commit d62a3f2

Browse files
committed
refactor(Process): replace PhpExecutableFinder with PhpSubprocess
- Simplified the process initialization by using PhpSubprocess. - Improved readability and maintainability of the code. - Ensured compatibility with the existing functionality.
1 parent c5d20d7 commit d62a3f2

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

composer-dependency-analyser.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;
1616

1717
return (new Configuration)
18-
->addPathsToScan(
19-
[
20-
// __DIR__.'/src/',
21-
],
22-
false
23-
)
18+
// ->addPathsToScan([__DIR__.'/config/'], false)
2419
->addPathsToExclude([
2520
__DIR__.'/src/Foundation/Rectors/',
2621
__DIR__.'/src/Foundation/Support/ComposerScripts.php',

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@
363363
"peck:init": "@peck --init",
364364
"pest": [
365365
"@putenv:xdebug-on",
366-
"@php vendor/bin/pest --colors=always --min=60 --coverage --profile",
366+
"@php vendor/bin/pest --colors=always --min=80 --coverage --profile",
367367
"@putenv:xdebug-off"
368368
],
369369
"pest:coverage": "@pest --coverage-html=.build/phpunit/ --coverage-clover=.build/phpunit/clover.xml",

monorepo-builder.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@
2222
use Symfony\Component\Console\Output\ConsoleOutput;
2323
use Symfony\Component\Console\Style\SymfonyStyle;
2424
use Symfony\Component\Process\ExecutableFinder;
25-
use Symfony\Component\Process\PhpExecutableFinder;
26-
use Symfony\Component\Process\Process;
25+
use Symfony\Component\Process\PhpSubprocess;
2726
use Symplify\MonorepoBuilder\Config\MBConfig;
2827
use Symplify\MonorepoBuilder\Contract\Git\TagResolverInterface;
2928
use Symplify\MonorepoBuilder\Git\BranchAwareTagResolver;
@@ -64,17 +63,8 @@
6463
// PushNextDevReleaseWorker::class,
6564
]);
6665

67-
if (
68-
\PHP_MAJOR_VERSION === 8 && \PHP_MINOR_VERSION === 1
69-
&& !(new ArgvInput)->hasParameterOption('--dry-run', true)
70-
) {
71-
(new Process([
72-
(new PhpExecutableFinder)->find(),
73-
(new ExecutableFinder)->find($composer = 'composer', $composer),
74-
'run',
75-
'checks:required',
76-
'--ansi',
77-
]))
66+
if (!(new ArgvInput)->hasParameterOption('--dry-run', true)) {
67+
(new PhpSubprocess([(new ExecutableFinder)->find('composer'), 'run', 'checks:required', '--ansi']))
7868
->setEnv(['COMPOSER_MEMORY_LIMIT' => -1])
7969
->setTimeout(600)
8070
->mustRun(static function (string $_, string $buffer): void {

0 commit comments

Comments
 (0)