From 35ddb07edc391053c04f44af5dda5d82c9aa99d3 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Tue, 12 Aug 2025 09:42:28 +0100 Subject: [PATCH] MDL-86279 core: fix deprecation emitting/annotation in AWS helpers. --- public/lib/classes/aws/admin_settings_aws_region.php | 2 +- public/lib/classes/aws/aws_helper.php | 11 ++++------- public/lib/classes/aws/client_factory.php | 6 +++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/public/lib/classes/aws/admin_settings_aws_region.php b/public/lib/classes/aws/admin_settings_aws_region.php index 1cee3f9b29e..4fe0b082686 100644 --- a/public/lib/classes/aws/admin_settings_aws_region.php +++ b/public/lib/classes/aws/admin_settings_aws_region.php @@ -27,7 +27,7 @@ require_once($CFG->dirroot . '/lib/adminlib.php'); * @copyright 2020 Catalyst IT * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @deprecated Since Moodle 4.5 - * @todo MDL-82459 Final deprecation in Moodle 5.0. + * @todo MDL-82459 Final deprecation in Moodle 6.0. */ class admin_settings_aws_region extends \admin_setting_configtext { diff --git a/public/lib/classes/aws/aws_helper.php b/public/lib/classes/aws/aws_helper.php index e6a7853836a..54a6fffb877 100644 --- a/public/lib/classes/aws/aws_helper.php +++ b/public/lib/classes/aws/aws_helper.php @@ -26,7 +26,7 @@ use Psr\Http\Message\RequestInterface; * @copyright 2020 Catalyst IT * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @deprecated Since Moodle 4.5 - * @todo MDL-82459 Final deprecation in Moodle 5.0. + * @todo MDL-82459 Final deprecation in Moodle 6.0. */ class aws_helper { @@ -37,12 +37,11 @@ class aws_helper { * @deprecated Since Moodle 4.5 */ #[\core\attribute\deprecated( - 'aws_helper::get_proxy_string()', since: '4.5', mdl: 'MDL-80962', )] public static function get_proxy_string(): string { - \core\deprecation::emit_deprecation(__FUNCTION__); + \core\deprecation::emit_deprecation([static::class, __FUNCTION__]); global $CFG; $proxy = ''; if (empty($CFG->proxytype)) { @@ -74,12 +73,11 @@ class aws_helper { * @deprecated Since Moodle 4.5 */ #[\core\attribute\deprecated( - 'aws_helper::configure_client_proxy()', since: '4.5', mdl: 'MDL-80962', )] public static function configure_client_proxy(AwsClient $client): AwsClient { - \core\deprecation::emit_deprecation(__FUNCTION__); + \core\deprecation::emit_deprecation([static::class, __FUNCTION__]); $client->getHandlerList()->appendBuild(self::add_proxy_when_required(), 'proxy_bypass'); return $client; } @@ -91,12 +89,11 @@ class aws_helper { * @deprecated Since Moodle 4.5 */ #[\core\attribute\deprecated( - 'aws_helper::add_proxy_when_required()', since: '4.5', mdl: 'MDL-80962', )] protected static function add_proxy_when_required(): callable { - \core\deprecation::emit_deprecation(__FUNCTION__); + \core\deprecation::emit_deprecation([static::class, __FUNCTION__]); return function (callable $fn) { return function (CommandInterface $command, ?RequestInterface $request = null) use ($fn) { if (isset($request)) { diff --git a/public/lib/classes/aws/client_factory.php b/public/lib/classes/aws/client_factory.php index a4fdf671155..c4d092413c7 100644 --- a/public/lib/classes/aws/client_factory.php +++ b/public/lib/classes/aws/client_factory.php @@ -24,7 +24,7 @@ use Aws\AwsClient; * @author Peter Burnett * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @deprecated Since Moodle 4.5 - * @todo MDL-82459 Final deprecation in Moodle 5.0. + * @todo MDL-82459 Final deprecation in Moodle 6.0. */ class client_factory { /** @@ -36,12 +36,12 @@ class client_factory { * @deprecated Since Moodle 4.5 */ #[\core\attribute\deprecated( - 'client_factory::get_client()', + 'aws_helper::configure_client_proxy()', since: '4.5', mdl: 'MDL-80962', )] public static function get_client(string $class, array $opts): AwsClient { - \core\deprecation::emit_deprecation(__FUNCTION__); + \core\deprecation::emit_deprecation([static::class, __FUNCTION__]); // Modify the opts to add HTTP timeouts. if (empty($opts['http'])) { $opts['http'] = ['connect_timeout' => HOURSECS];