From 7ef87626ac0e422da9593c93fc5dd878ad917ff8 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Tue, 8 Sep 2020 11:42:50 +0200 Subject: [PATCH] Fixed self usage in closure fails on PHP 5.3 --- src/Composer/Util/HttpDownloader.php | 8 ++++---- src/Composer/Util/ProcessExecutor.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Composer/Util/HttpDownloader.php b/src/Composer/Util/HttpDownloader.php index 889fae07e..a6d5aa670 100644 --- a/src/Composer/Util/HttpDownloader.php +++ b/src/Composer/Util/HttpDownloader.php @@ -188,13 +188,13 @@ class HttpDownloader $curl = $this->curl; $canceler = function () use (&$job, $curl) { - if ($job['status'] === self::STATUS_QUEUED) { - $job['status'] = self::STATUS_ABORTED; + if ($job['status'] === HttpDownloader::STATUS_QUEUED) { + $job['status'] = HttpDownloader::STATUS_ABORTED; } - if ($job['status'] !== self::STATUS_STARTED) { + if ($job['status'] !== HttpDownloader::STATUS_STARTED) { return; } - $job['status'] = self::STATUS_ABORTED; + $job['status'] = HttpDownloader::STATUS_ABORTED; if (isset($job['curl_id'])) { $curl->abortRequest($job['curl_id']); } diff --git a/src/Composer/Util/ProcessExecutor.php b/src/Composer/Util/ProcessExecutor.php index 96b9235c8..b0f32d988 100644 --- a/src/Composer/Util/ProcessExecutor.php +++ b/src/Composer/Util/ProcessExecutor.php @@ -158,13 +158,13 @@ class ProcessExecutor $io = $this->io; $canceler = function () use (&$job) { - if ($job['status'] === self::STATUS_QUEUED) { - $job['status'] = self::STATUS_ABORTED; + if ($job['status'] === ProcessExecutor::STATUS_QUEUED) { + $job['status'] = ProcessExecutor::STATUS_ABORTED; } - if ($job['status'] !== self::STATUS_STARTED) { + if ($job['status'] !== ProcessExecutor::STATUS_STARTED) { return; } - $job['status'] = self::STATUS_ABORTED; + $job['status'] = ProcessExecutor::STATUS_ABORTED; try { if (defined('SIGINT')) { $job['process']->signal(SIGINT);