From 67c136ea3d08dad6ac0389f0982892998015b289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Hiort=20af=20Orn=C3=A4s?= Date: Tue, 1 Oct 2024 10:42:27 +0300 Subject: [PATCH] [Notifier] [GatewayAPI] Add support for label parameter --- .../Component/Notifier/Bridge/GatewayApi/CHANGELOG.md | 5 +++++ .../Notifier/Bridge/GatewayApi/GatewayApiOptions.php | 10 ++++++++++ .../Component/Notifier/Bridge/GatewayApi/README.md | 1 + .../Bridge/GatewayApi/Tests/GatewayApiOptionsTest.php | 4 +++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Notifier/Bridge/GatewayApi/CHANGELOG.md b/src/Symfony/Component/Notifier/Bridge/GatewayApi/CHANGELOG.md index d87c05f80f0f6..914408659ef7d 100644 --- a/src/Symfony/Component/Notifier/Bridge/GatewayApi/CHANGELOG.md +++ b/src/Symfony/Component/Notifier/Bridge/GatewayApi/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +7.2 +--- + + * Add label option to `GatewayApiOptions` class + 6.3 --- diff --git a/src/Symfony/Component/Notifier/Bridge/GatewayApi/GatewayApiOptions.php b/src/Symfony/Component/Notifier/Bridge/GatewayApi/GatewayApiOptions.php index 89f81837838d3..31b334f3c6e62 100644 --- a/src/Symfony/Component/Notifier/Bridge/GatewayApi/GatewayApiOptions.php +++ b/src/Symfony/Component/Notifier/Bridge/GatewayApi/GatewayApiOptions.php @@ -58,6 +58,16 @@ public function callbackUrl(string $callbackUrl): static return $this; } + /** + * @return $this + */ + public function label(string $label): static + { + $this->options['label'] = $label; + + return $this; + } + public function toArray(): array { return $this->options; diff --git a/src/Symfony/Component/Notifier/Bridge/GatewayApi/README.md b/src/Symfony/Component/Notifier/Bridge/GatewayApi/README.md index d1f46a07176e6..37535e2f840eb 100644 --- a/src/Symfony/Component/Notifier/Bridge/GatewayApi/README.md +++ b/src/Symfony/Component/Notifier/Bridge/GatewayApi/README.md @@ -32,6 +32,7 @@ $options = (new GatewayApiOptions()) ->class('standard') ->callbackUrl('https://my-callback-url') ->userRef('user_ref') + ->label('label') // ... ; diff --git a/src/Symfony/Component/Notifier/Bridge/GatewayApi/Tests/GatewayApiOptionsTest.php b/src/Symfony/Component/Notifier/Bridge/GatewayApi/Tests/GatewayApiOptionsTest.php index 009afc65332bf..a939a85c3824f 100644 --- a/src/Symfony/Component/Notifier/Bridge/GatewayApi/Tests/GatewayApiOptionsTest.php +++ b/src/Symfony/Component/Notifier/Bridge/GatewayApi/Tests/GatewayApiOptionsTest.php @@ -21,12 +21,14 @@ public function testGatewayApiOptions() $gatewayApiOptions = (new GatewayApiOptions()) ->class('test_class') ->callbackUrl('test_callback_url') - ->userRef('test_user_ref'); + ->userRef('test_user_ref') + ->label('test_label'); self::assertSame([ 'class' => 'test_class', 'callback_url' => 'test_callback_url', 'userref' => 'test_user_ref', + 'label' => 'test_label', ], $gatewayApiOptions->toArray()); } }