Skip to content

Commit 7183cd7

Browse files
committed
fix open version replacement
1 parent 7c4b0a8 commit 7183cd7

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"composer/semver": "^3.4",
1111
"illuminate/container": "^12.0",
1212
"nette/utils": "^4.0",
13-
^6.4|7.0.*,
13+
"symfony/console": "^6.4",
1414
"symfony/finder": "^7.2",
1515
"symfony/process": "^7.2",
1616
"webmozart/assert": "^1.11"
@@ -67,4 +67,3 @@
6767

6868

6969

70-

src/Command/OpenVersionsCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
110110
// replace using regex, to keep original composer.json format
111111
$composerJsonContents = Strings::replace(
112112
$composerJsonContents,
113+
// find
113114
sprintf('#"%s": "(.*?)"#', $outdatedPackage->getName()),
114-
$openedVersion
115+
// replace
116+
sprintf('"%s": "%s"', $outdatedPackage->getName(), $openedVersion)
115117
);
116118

117119
$this->symfonyStyle->writeln(sprintf(

src/DependencyInjection/ContainerFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Illuminate\Container\Container;
88
use Rector\Jack\Console\JackConsoleApplication;
99
use Symfony\Component\Console\Application;
10-
use Symfony\Component\Console\Input\ArrayInput;
10+
use Symfony\Component\Console\Input\ArgvInput;
1111
use Symfony\Component\Console\Output\ConsoleOutput;
1212
use Symfony\Component\Console\Style\SymfonyStyle;
1313
use Symfony\Component\Finder\Finder;
@@ -42,7 +42,7 @@ public function create(): Container
4242

4343
$container->singleton(
4444
SymfonyStyle::class,
45-
static fn (): SymfonyStyle => new SymfonyStyle(new ArrayInput([]), new ConsoleOutput())
45+
static fn (): SymfonyStyle => new SymfonyStyle(new ArgvInput(), new ConsoleOutput())
4646
);
4747

4848
return $container;

src/ValueObject/OutdatedComposer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ public function getPackagesShuffled(bool $onlyDev, ?string $packagePrefix): arra
7676
if ($packagePrefix !== null) {
7777
$outdatedPackages = array_filter(
7878
$outdatedPackages,
79-
fn (OutdatedPackage $outdatedPackage): bool => str_starts_with($outdatedPackage->getName(), $packagePrefix)
79+
fn (OutdatedPackage $outdatedPackage): bool => str_starts_with(
80+
$outdatedPackage->getName(),
81+
$packagePrefix
82+
)
8083
);
8184
}
8285

0 commit comments

Comments
 (0)