8000 Fix: Use dedicated options array · symfony/symfony@8a53301 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a53301

Browse files
committed
Fix: Use dedicated options array
1 parent add3dc5 commit 8a53301

File tree

7 files changed

+16
-10
lines changed

7 files changed

+16
-10
lines changed

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Action/ActionCard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
final class ActionCard implements ActionInterface
2323
{
24-
protected $options = ['@type' => 'ActionCard'];
24+
private $options = [];
2525

2626
public function name(string $name): self
2727
{
@@ -46,6 +46,6 @@ public function action(ActionCardCompatibleActionInterface $action): self
4646

4747
public function toArray(): array
4848
{
49-
return $this->options;
49+
return $this->options + ['@type' => 'ActionCard'];
5050
}
5151
}

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Action/HttpPostAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*/
2222
final class HttpPostAction implements ActionCardCompatibleActionInterface
2323
{
24-
protected $options = ['@type' => 'HttpPOST'];
24+
private $options = ['@type' => 'HttpPOST'];
2525

2626
public function name(string $name): self
2727
{

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Action/Input/DateInput.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
*/
2020
final class DateInput extends AbstractInput
2121
{
22+
private $options = [];
23+
2224
public function includeTime(bool $includeTime): self
2325
{
2426
$this->options['includeTime'] = $includeTime;
@@ -30,6 +32,6 @@ public function toArray(): array
3032
{
3133
$this->options['@type'] = 'DateInput';
3234

33-
return parent::toArray();
35+
return parent::toArray() + $this->options;
3436
}
3537
}

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Action/Input/MultiChoiceInput.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ final class MultiChoiceInput extends AbstractInput
2626
'normal',
2727
];
2828

29+
private $options = [];
30+
2931
public function choice(string $display, string $value): self
3032
{
3133
$this->options['choices'][] = ['display' => $display, 'value' => $value];
@@ -55,6 +57,6 @@ public function toArray(): array
5557
{
5658
$this->options['@type'] = 'MultichoiceInput';
5759

58-
return parent::toArray();
60+
return parent::toArray() + $this->options;
5961
}
6062
}

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Action/Input/TextInput.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
*/
2020
final class TextInput extends AbstractInput
2121
{
22+
private $options = [];
23+
2224
public function isMultiline(bool $multiline): self
2325
{
2426
$this->options['isMultiline'] = $multiline;
@@ -37,6 +39,6 @@ public function toArray(): array
3739
{
3840
$this->options['@type'] = 'TextInput';
3941

40-
return parent::toArray();
42+
return parent::toArray() + $this->options;
4143
}
4244
}

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Action/InvokeAddInCommandAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
final class InvokeAddInCommandAction implements ActionInterface
2121
{
22-
protected $options = ['@type' => 'InvokeAddInCommand'];
22+
private $options = [];
2323

2424
public function name(string $name): self
2525
{
@@ -51,6 +51,6 @@ public function initializationContext(array $context): self
5151

5252
public function toArray(): array
5353
{
54-
return $this->options;
54+
return $this->options + ['@type' => 'InvokeAddInCommand'];
5555
}
5656
}

src/Symfony/Component/Notifier/Bridge/MicrosoftTeams/Action/OpenUriAction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class OpenUriAction implements ActionCardCompatibleActionInterface
2828
'windows',
2929
];
3030

31-
protected $options = ['@type' => 'OpenUri'];
31+
private $options = [];
3232

3333
public function name(string $name): self
3434
{
@@ -50,6 +50,6 @@ public function target(string $uri, string $os = 'default'): self
5050

5151
public function toArray(): array
5252
{
53-
return $this->options;
53+
return $this->options + ['@type' => 'OpenUri'];
5454
}
5555
}

0 commit comments

Comments
 (0)
0