Skip to content

Commit

Permalink
Various udpates and more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaEstes committed Oct 20, 2024
1 parent 775dae5 commit 3a710cf
Show file tree
Hide file tree
Showing 24 changed files with 190 additions and 133 deletions.
4 changes: 2 additions & 2 deletions src/SonsOfPHP/Bard/Tests/Console/Command/AddCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use SonsOfPHP\Bard\Console\Command\SplitCommand;
use SonsOfPHP\Bard\Console\Command\UpdateCommand;
use SonsOfPHP\Bard\JsonFile;
use SonsOfPHP\Bard\Worker\File\Bard\AddPackageWorker;
use SonsOfPHP\Bard\Operation\Bard\AddPackageOperation;
use Symfony\Component\Console\Tester\CommandTester;

#[Group('bard')]
Expand All @@ -38,7 +38,7 @@
#[UsesClass(SplitCommand::class)]
#[UsesClass(UpdateCommand::class)]
#[UsesClass(JsonFile::class)]
#[UsesClass(AddPackageWorker::class)]
#[UsesClass(AddPackageOperation::class)]
final class AddCommandTest extends TestCase
{
private Application $application;
Expand Down
4 changes: 2 additions & 2 deletions src/SonsOfPHP/Bard/Tests/Console/Command/CopyCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use SonsOfPHP\Bard\Console\Command\SplitCommand;
use SonsOfPHP\Bard\Console\Command\UpdateCommand;
use SonsOfPHP\Bard\JsonFile;
use SonsOfPHP\Bard\Worker\File\Bard\AddPackageWorker;
use SonsOfPHP\Bard\Operation\Bard\AddPackageOperation;
use Symfony\Component\Console\Tester\CommandTester;

#[Group('bard')]
Expand All @@ -38,7 +38,7 @@
#[UsesClass(SplitCommand::class)]
#[UsesClass(UpdateCommand::class)]
#[UsesClass(JsonFile::class)]
#[UsesClass(AddPackageWorker::class)]
#[UsesClass(AddPackageOperation::class)]
final class CopyCommandTest extends TestCase
{
private Application $application;
Expand Down
44 changes: 22 additions & 22 deletions src/SonsOfPHP/Bard/Tests/Console/Command/MergeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
use SonsOfPHP\Bard\Console\Command\SplitCommand;
use SonsOfPHP\Bard\Console\Command\UpdateCommand;
use SonsOfPHP\Bard\JsonFile;
use SonsOfPHP\Bard\Worker\File\Composer\Package\Authors;
use SonsOfPHP\Bard\Worker\File\Composer\Package\BranchAlias;
use SonsOfPHP\Bard\Worker\File\Composer\Package\Funding;
use SonsOfPHP\Bard\Worker\File\Composer\Package\Support;
use SonsOfPHP\Bard\Worker\File\Composer\Root\ClearSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateAutoloadDevSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateAutoloadSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateProvideSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateReplaceSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateRequireDevSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateRequireSection;
use SonsOfPHP\Bard\Operation\ClearSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateAuthorsSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateBranchAliasSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateFundingSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateSupportSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateAutoloadDevSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateAutoloadSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateProvideSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateReplaceSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateRequireDevSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateRequireSectionOperation;
use Symfony\Component\Console\Tester\CommandTester;

#[Group('bard')]
Expand All @@ -48,17 +48,17 @@
#[UsesClass(SplitCommand::class)]
#[UsesClass(UpdateCommand::class)]
#[UsesClass(JsonFile::class)]
#[UsesClass(Authors::class)]
#[UsesClass(BranchAlias::class)]
#[UsesClass(Funding::class)]
#[UsesClass(Support::class)]
#[UsesClass(ClearSection::class)]
#[UsesClass(UpdateAutoloadDevSection::class)]
#[UsesClass(UpdateAutoloadSection::class)]
#[UsesClass(UpdateProvideSection::class)]
#[UsesClass(UpdateReplaceSection::class)]
#[UsesClass(UpdateRequireSection::class)]
#[UsesClass(UpdateRequireDevSection::class)]
#[UsesClass(UpdateAuthorsSectionOperation::class)]
#[UsesClass(UpdateBranchAliasSectionOperation::class)]
#[UsesClass(UpdateFundingSectionOperation::class)]
#[UsesClass(UpdateSupportSectionOperation::class)]
#[UsesClass(ClearSectionOperation::class)]
#[UsesClass(UpdateAutoloadDevSectionOperation::class)]
#[UsesClass(UpdateAutoloadSectionOperation::class)]
#[UsesClass(UpdateProvideSectionOperation::class)]
#[UsesClass(UpdateReplaceSectionOperation::class)]
#[UsesClass(UpdateRequireSectionOperation::class)]
#[UsesClass(UpdateRequireDevSectionOperation::class)]
final class MergeCommandTest extends TestCase
{
private Application $application;
Expand Down
4 changes: 2 additions & 2 deletions src/SonsOfPHP/Bard/Tests/Console/Command/PushCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use SonsOfPHP\Bard\Console\Command\SplitCommand;
use SonsOfPHP\Bard\Console\Command\UpdateCommand;
use SonsOfPHP\Bard\JsonFile;
use SonsOfPHP\Bard\Worker\File\Bard\AddPackageWorker;
use SonsOfPHP\Bard\Operation\Bard\AddPackageOperation;
use Symfony\Component\Console\Tester\CommandTester;

#[Group('bard')]
Expand All @@ -38,7 +38,7 @@
#[UsesClass(SplitCommand::class)]
#[UsesClass(UpdateCommand::class)]
#[UsesClass(JsonFile::class)]
#[UsesClass(AddPackageWorker::class)]
#[UsesClass(AddPackageOperation::class)]
final class PushCommandTest extends TestCase
{
private Application $application;
Expand Down
12 changes: 6 additions & 6 deletions src/SonsOfPHP/Bard/Tests/Console/Command/ReleaseCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
use SonsOfPHP\Bard\Console\Command\SplitCommand;
use SonsOfPHP\Bard\Console\Command\UpdateCommand;
use SonsOfPHP\Bard\JsonFile;
use SonsOfPHP\Bard\Worker\File\Bard\UpdateVersionWorker;
use SonsOfPHP\Bard\Worker\File\Composer\Package\BranchAlias;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateReplaceSection;
use SonsOfPHP\Bard\Operation\Bard\UpdateVersionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateBranchAliasSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateReplaceSectionOperation;
use SonsOfPHP\Component\Version\Version;
use Symfony\Component\Console\Tester\CommandTester;

Expand All @@ -41,9 +41,9 @@
#[UsesClass(SplitCommand::class)]
#[UsesClass(UpdateCommand::class)]
#[UsesClass(JsonFile::class)]
#[UsesClass(UpdateVersionWorker::class)]
#[UsesClass(BranchAlias::class)]
#[UsesClass(UpdateReplaceSection::class)]
#[UsesClass(UpdateVersionOperation::class)]
#[UsesClass(UpdateBranchAliasSectionOperation::class)]
#[UsesClass(UpdateReplaceSectionOperation::class)]
#[UsesClass(Version::class)]
final class ReleaseCommandTest extends TestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

declare(strict_types=1);

namespace SonsOfPHP\Bard\Tests\File\Bard;
namespace SonsOfPHP\Bard\Tests\Operation\Bard;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use SonsOfPHP\Bard\JsonFileInterface;
use SonsOfPHP\Bard\Worker\File\Bard\AddPackageWorker;
use SonsOfPHP\Bard\Worker\WorkerInterface;
use SonsOfPHP\Bard\Operation\Bard\AddPackageOperation;
use SonsOfPHP\Bard\Operation\OperationInterface;

#[Group('bard')]
#[CoversClass(AddPackageWorker::class)]
final class AddPackageWorkerTest extends TestCase
#[CoversClass(AddPackageOperation::class)]
final class AddPackageOperationTest extends TestCase
{
private AddPackageWorker $worker;
private AddPackageOperation $worker;

private JsonFileInterface&MockObject $jsonFile;

protected function setUp(): void
{
$this->worker = new AddPackageWorker([
$this->worker = new AddPackageOperation([
'path' => 'src/test',
'repository' => 'git@github.com:vendor/repo.git',
]);
Expand All @@ -32,7 +32,7 @@ protected function setUp(): void

public function testItImplementsCorrectInterface(): void
{
$this->assertInstanceOf(WorkerInterface::class, $this->worker);
$this->assertInstanceOf(OperationInterface::class, $this->worker);
}

public function testItWillThrowExceptionWhenPackageAtSamePathExists(): void
Expand All @@ -53,13 +53,10 @@ public function testItWillAddNewPackage(): void
$this->jsonFile->expects($this->once())->method('setSection')
->with(
'packages',
$this->callback(function ($packages): true {
$this->assertSame([[
'path' => 'src/test',
'repository' => 'git@github.com:vendor/repo.git',
]], $packages);
return true;
})
$this->callback(fn($packages): true => [[

Check failure on line 56 in src/SonsOfPHP/Bard/Tests/Operation/Bard/AddPackageOperationTest.php

View workflow job for this annotation

GitHub Actions / Psalm (8.2)

InvalidReturnType

src/SonsOfPHP/Bard/Tests/Operation/Bard/AddPackageOperationTest.php:56:48: InvalidReturnType: The declared return type 'true' for /home/runner/work/sonsofphp/sonsofphp/src/sonsofphp/bard/tests/operation/bard/addpackageoperationtest.php:56:1637:-:closure is incorrect, got 'bool' (see https://psalm.dev/011)

Check failure on line 56 in src/SonsOfPHP/Bard/Tests/Operation/Bard/AddPackageOperationTest.php

View workflow job for this annotation

GitHub Actions / Psalm (8.2)

InvalidReturnStatement

src/SonsOfPHP/Bard/Tests/Operation/Bard/AddPackageOperationTest.php:56:56: InvalidReturnStatement: The inferred type 'bool' does not match the declared return type 'true' for /home/runner/work/sonsofphp/sonsofphp/src/sonsofphp/bard/tests/operation/bard/addpackageoperationtest.php:56:1637:-:closure (see https://psalm.dev/128)
'path' => 'src/test',
'repository' => 'git@github.com:vendor/repo.git',
]] === $packages)
)
;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

declare(strict_types=1);

namespace SonsOfPHP\Bard\Tests\Operation\Bard;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use SonsOfPHP\Bard\JsonFileInterface;
use SonsOfPHP\Bard\Operation\Bard\UpdateVersionOperation;
use SonsOfPHP\Bard\Operation\OperationInterface;
use SonsOfPHP\Component\Version\VersionInterface;

#[Group('bard')]
#[CoversClass(UpdateVersionOperation::class)]
final class UpdateVersionOperationTest extends TestCase
{
private UpdateVersionOperation $worker;

private JsonFileInterface&MockObject $jsonFile;

private VersionInterface&MockObject $version;

protected function setUp(): void
{
$this->version = $this->createMock(VersionInterface::class);
$this->worker = new UpdateVersionOperation($this->version);

$this->jsonFile = $this->createMock(JsonFileInterface::class);
}

public function testItImplementsCorrectInterface(): void
{
$this->assertInstanceOf(OperationInterface::class, $this->worker);
}

public function testItWillUpdateVersionSection(): void
{
$this->version->method('toString')->willReturn('1.2.3');
$this->jsonFile->expects($this->once())->method('setSection')->with(
'version',
$this->callback(fn($version): true => '1.2.3' === $version)

Check failure on line 44 in src/SonsOfPHP/Bard/Tests/Operation/Bard/UpdateVersionOperationTest.php

View workflow job for this annotation

GitHub Actions / Psalm (8.2)

InvalidReturnType

src/SonsOfPHP/Bard/Tests/Operation/Bard/UpdateVersionOperationTest.php:44:43: InvalidReturnType: The declared return type 'true' for /home/runner/work/sonsofphp/sonsofphp/src/sonsofphp/bard/tests/operation/bard/updateversionoperationtest.php:44:1377:-:closure is incorrect, got 'bool' (see https://psalm.dev/011)

Check failure on line 44 in src/SonsOfPHP/Bard/Tests/Operation/Bard/UpdateVersionOperationTest.php

View workflow job for this annotation

GitHub Actions / Psalm (8.2)

InvalidReturnStatement

src/SonsOfPHP/Bard/Tests/Operation/Bard/UpdateVersionOperationTest.php:44:51: InvalidReturnStatement: The inferred type 'bool' does not match the declared return type 'true' for /home/runner/work/sonsofphp/sonsofphp/src/sonsofphp/bard/tests/operation/bard/updateversionoperationtest.php:44:1377:-:closure (see https://psalm.dev/128)
);

$this->worker->apply($this->jsonFile);
}
}
4 changes: 2 additions & 2 deletions src/SonsOfPHP/Bard/src/Console/Command/AddCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace SonsOfPHP\Bard\Console\Command;

use SonsOfPHP\Bard\Worker\File\Bard\AddPackageWorker;
use SonsOfPHP\Bard\Operation\Bard\AddPackageOperation;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -45,7 +45,7 @@ protected function configure(): void

protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->bardConfig = $this->bardConfig->with(new AddPackageWorker([
$this->bardConfig = $this->bardConfig->with(new AddPackageOperation([
'path' => $input->getArgument('path'),
'repository' => $input->getArgument('repository'),
]));
Expand Down
54 changes: 27 additions & 27 deletions src/SonsOfPHP/Bard/src/Console/Command/MergeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

use RuntimeException;
use SonsOfPHP\Bard\JsonFile;
use SonsOfPHP\Bard\Worker\File\Composer\Package\Authors;
use SonsOfPHP\Bard\Worker\File\Composer\Package\BranchAlias;
use SonsOfPHP\Bard\Worker\File\Composer\Package\Funding;
use SonsOfPHP\Bard\Worker\File\Composer\Package\Support;
use SonsOfPHP\Bard\Worker\File\Composer\Root\ClearSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateAutoloadDevSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateAutoloadSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateProvideSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateReplaceSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateRequireDevSection;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateRequireSection;
use SonsOfPHP\Bard\Operation\ClearSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateAuthorsSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateBranchAliasSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateFundingSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateSupportSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateAutoloadDevSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateAutoloadSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateProvideSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateReplaceSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateRequireDevSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateRequireSectionOperation;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -67,12 +67,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$rootComposerJsonFile = new JsonFile($input->getOption('working-dir') . '/composer.json');

// Clean out a few of the sections in root composer.json file
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSection('autoload'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSection('autoload-dev'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSection('require'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSection('require-dev'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSection('replace'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSection('provide'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSectionOperation('autoload'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSectionOperation('autoload-dev'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSectionOperation('require'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSectionOperation('require-dev'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSectionOperation('replace'));
$rootComposerJsonFile = $rootComposerJsonFile->with(new ClearSectionOperation('provide'));

foreach ($this->bardConfig->getSection('packages') as $pkg) {
$pkgComposerFile = realpath($input->getOption('working-dir') . '/' . $pkg['path'] . '/composer.json');
Expand All @@ -90,19 +90,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln($this->getFormatterHelper()->formatSection('bard', sprintf('Merging "%s" into root composer.json', $pkgComposerJsonFile->getSection('name'))));

// Update root composer.json
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateReplaceSection($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateRequireSection($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateRequireDevSection($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateAutoloadSection($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateAutoloadDevSection($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateProvideSection($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateReplaceSectionOperation($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateRequireSectionOperation($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateRequireDevSectionOperation($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateAutoloadSectionOperation($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateAutoloadDevSectionOperation($pkgComposerJsonFile));
$rootComposerJsonFile = $rootComposerJsonFile->with(new UpdateProvideSectionOperation($pkgComposerJsonFile));
// $rootComposerJsonFile = $rootComposerJsonFile->with(new Conflict($pkgComposerJsonFile));

// Update package composer.json
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new BranchAlias($rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new Support($rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new Authors($rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new Funding($rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new UpdateBranchAliasSectionOperation($rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new UpdateSupportSectionOperation($rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new UpdateAuthorsSectionOperation($rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new UpdateFundingSectionOperation($rootComposerJsonFile));

if (!$isDryRun) {
file_put_contents($pkgComposerJsonFile->getFilename(), $pkgComposerJsonFile->toJson());
Expand Down
12 changes: 6 additions & 6 deletions src/SonsOfPHP/Bard/src/Console/Command/ReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

use RuntimeException;
use SonsOfPHP\Bard\JsonFile;
use SonsOfPHP\Bard\Worker\File\Bard\UpdateVersionWorker;
use SonsOfPHP\Bard\Worker\File\Composer\Package\BranchAlias;
use SonsOfPHP\Bard\Worker\File\Composer\Root\UpdateReplaceSection;
use SonsOfPHP\Bard\Operation\Bard\UpdateVersionOperation;
use SonsOfPHP\Bard\Operation\Composer\Package\UpdateBranchAliasSectionOperation;
use SonsOfPHP\Bard\Operation\Composer\Root\UpdateReplaceSectionOperation;
use SonsOfPHP\Component\Version\Version;
use SonsOfPHP\Component\Version\VersionInterface;
use Symfony\Component\Console\Input\ArrayInput;
Expand Down Expand Up @@ -157,7 +157,7 @@ private function updateReplace(InputInterface $input, OutputInterface $output):
foreach ($this->bardConfig->getSection('packages') as $pkg) {
$pkgComposerJsonFile = new JsonFile(realpath($input->getOption('working-dir') . '/' . $pkg['path'] . '/composer.json'));
$output->writeln($this->getFormatterHelper()->formatSection($pkgComposerJsonFile->getSection('name'), 'Updating root <info>composer.json</info>'));
$this->rootComposerJsonFile = $this->rootComposerJsonFile->with(new UpdateReplaceSection($pkgComposerJsonFile));
$this->rootComposerJsonFile = $this->rootComposerJsonFile->with(new UpdateReplaceSectionOperation($pkgComposerJsonFile));
}

if (!$this->isDryRun) {
Expand Down Expand Up @@ -240,7 +240,7 @@ private function updateBranchAliasForPackages(InputInterface $input, OutputInter

foreach ($this->bardConfig->getSection('packages') as $pkg) {
$pkgComposerJsonFile = new JsonFile(realpath($input->getOption('working-dir') . '/' . $pkg['path'] . '/composer.json'));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new BranchAlias($this->rootComposerJsonFile));
$pkgComposerJsonFile = $pkgComposerJsonFile->with(new UpdateBranchAliasSectionOperation($this->rootComposerJsonFile));
$output->writeln($this->getFormatterHelper()->formatSection($pkgComposerJsonFile->getSection('name'), 'Updated branch alias to "' . $branchAlias . '"'));
if (!$this->isDryRun) {
$pkgComposerJsonFile->save();
Expand All @@ -253,7 +253,7 @@ private function updateBranchAliasForPackages(InputInterface $input, OutputInter
private function updateBardConfigVersion(): void
{
$this->io->section('Updating version in bard.json');
$this->bardConfig = $this->bardConfig->with(new UpdateVersionWorker($this->releaseVersion));
$this->bardConfig = $this->bardConfig->with(new UpdateVersionOperation($this->releaseVersion));
if (!$this->isDryRun) {
$this->bardConfig->save();
}
Expand Down
Loading

0 comments on commit 3a710cf

Please sign in to comment.