minor: Simplify bump script by merging require loops

This commit is contained in:
Oskar Stark
2026-02-19 11:57:06 +01:00
parent beba7c9c32
commit 4fb0dd2c34

20
bump
View File

@@ -165,19 +165,13 @@ use Symfony\Component\Finder\Finder;
$modified = false;
$fileUpdates = 0;
foreach ($data['require'] ?? [] as $package => $constraint) {
if (str_starts_with($package, 'symfony/ai-') || 'symfony/mcp-bundle' === $package) {
$data['require'][$package] = $composerConstraint;
$modified = true;
++$fileUpdates;
}
}
foreach ($data['require-dev'] ?? [] as $package => $constraint) {
if (str_starts_with($package, 'symfony/ai-') || 'symfony/mcp-bundle' === $package) {
$data['require-dev'][$package] = $composerConstraint;
$modified = true;
++$fileUpdates;
foreach (['require', 'require-dev'] as $section) {
foreach ($data[$section] ?? [] as $package => $constraint) {
if (str_starts_with($package, 'symfony/ai-') || 'symfony/mcp-bundle' === $package) {
$data[$section][$package] = $composerConstraint;
$modified = true;
++$fileUpdates;
}
}
}