diff options
Diffstat (limited to 'app-admin/drush/files/drush-6.7.0-batch-signature-fix-r1.patch')
-rw-r--r-- | app-admin/drush/files/drush-6.7.0-batch-signature-fix-r1.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/app-admin/drush/files/drush-6.7.0-batch-signature-fix-r1.patch b/app-admin/drush/files/drush-6.7.0-batch-signature-fix-r1.patch new file mode 100644 index 000000000000..14ee72b7dc4a --- /dev/null +++ b/app-admin/drush/files/drush-6.7.0-batch-signature-fix-r1.patch @@ -0,0 +1,46 @@ +From 1acd52cff0d516ebfa7f177c38ed7f851c4f472a Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Wed, 16 Aug 2023 21:21:39 -0400 +Subject: [PATCH] includes/batch.inc: synchronize sub and superclass signatures + +The DrushBatchContext class overrides the offsetSet() method of its +superclass, ArrayObject, but changes its signature: + + Error: Return type of DrushBatchContext::offsetSet($name, $value) + should either be compatible with ArrayObject::offsetSet(mixed $key, + mixed $value): void, or the #[\ReturnTypeWillChange] attribute should + be used to temporarily suppress the notice in .../batch.inc, line 37 + +Renaming the parameter to $key and adding type hints fixes the issue. + +Signed-off-by: Michael Orlitzky <michael@orlitzky.com> +--- + includes/batch.inc | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/includes/batch.inc b/includes/batch.inc +index dd4adc9..d26fabb 100644 +--- a/includes/batch.inc ++++ b/includes/batch.inc +@@ -34,14 +34,14 @@ + * @see _drush_batch_worker(). + */ + class DrushBatchContext extends ArrayObject { +- function offsetSet($name, $value) { +- if ($name == 'message') { ++ function offsetSet(mixed $key, mixed $value): void { ++ if ($key == 'message') { + drush_log(strip_tags($value), 'ok'); + } +- elseif ($name == 'error_message') { ++ elseif ($key == 'error_message') { + drush_set_error('DRUSH_BATCH_ERROR', strip_tags($value)); + } +- parent::offsetSet($name, $value); ++ parent::offsetSet($key, $value); + } + } + +-- +2.43.2 + |