From aed0eee4ae6c2cb926b480ea016ea530ac4c6998 Mon Sep 17 00:00:00 2001 From: Piotr Matras Date: Fri, 25 Apr 2025 10:50:03 +0200 Subject: [PATCH 1/2] feat: MGS-5456 add php84 compatibility --- src/PatchApplication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PatchApplication.php b/src/PatchApplication.php index ad04753..e12de4e 100644 --- a/src/PatchApplication.php +++ b/src/PatchApplication.php @@ -39,7 +39,7 @@ public function __construct( Patch $patch, PackageInterface $sourcePackage = null, PackageInterface $targetPackage, - $hash + string $hash ) { $this->patch = $patch; $this->sourcePackage = $sourcePackage; From 22acfc16ea6ff158c2280e3fbc7bd20f9ad675be Mon Sep 17 00:00:00 2001 From: Piotr Matras Date: Fri, 25 Apr 2025 10:53:43 +0200 Subject: [PATCH 2/2] feat: MGS-5456 add compatibility with php84 --- .../PatchApplicationFailedException.php | 2 +- src/Patch.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Exception/PatchApplicationFailedException.php b/src/Exception/PatchApplicationFailedException.php index 42cee19..ef70952 100644 --- a/src/Exception/PatchApplicationFailedException.php +++ b/src/Exception/PatchApplicationFailedException.php @@ -16,7 +16,7 @@ class PatchApplicationFailedException extends PatchingException */ private $cmdOutput; - public function __construct($cmd, $cmdOutput, $message = "", $code = 0, Throwable $previous = null) + public function __construct(string $cmd, string $cmdOutput, string $message = "", int $code = 0, Throwable $previous = null) { if (empty($message)) { $message = "Could not apply patch - command \"$cmd\" failed with: \n$cmdOutput"; diff --git a/src/Patch.php b/src/Patch.php index 364b96c..3cd2d9e 100644 --- a/src/Patch.php +++ b/src/Patch.php @@ -69,14 +69,14 @@ class Patch * @param bool $keepEmptyFiles */ public function __construct( - $sourcePackage, - $targetPackage, - $versionConstraint, - $filename, - $description, - $stripPathComponents = 1, - $method = PatchApplicator::METHOD_PATCH, - $keepEmptyFiles = false + string $sourcePackage, + string $targetPackage, + string $versionConstraint, + string $filename, + string $description, + int $stripPathComponents = 1, + string $method = PatchApplicator::METHOD_PATCH, + bool $keepEmptyFiles = false ) { $this->sourcePackage = $sourcePackage; $this->targetPackage = $targetPackage;