From e2d182d0ad0ac2a0163a784bef22e997c2d2fd4c Mon Sep 17 00:00:00 2001 From: Nathanael Esayeas Date: Wed, 17 Jul 2024 13:59:24 -0500 Subject: [PATCH] Add UpdateComposerDevPackageVersion.php Signed-off-by: Nathanael Esayeas --- src/Task/UpdateComposerDevPackageVersion.php | 40 ++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/Task/UpdateComposerDevPackageVersion.php diff --git a/src/Task/UpdateComposerDevPackageVersion.php b/src/Task/UpdateComposerDevPackageVersion.php new file mode 100644 index 0000000..ac823fe --- /dev/null +++ b/src/Task/UpdateComposerDevPackageVersion.php @@ -0,0 +1,40 @@ +packages as $package => $version) { + $this->update($path, $package, $version); + } + } + + #[Override] + public function packages(): array + { + return $this->packages; + } + + private function update(string $path, string $package, string $version): void + { + (new Process(['composer', 'require', '--dev', sprintf('%s:%s', $package, $version)], $path))->mustRun(); + } +}