Modal clear_on_close/notify_on_close defaults to TRUE, change MultiExternalSelect initial_options to be a collection

This commit is contained in:
Deon George 2022-09-08 13:39:57 +10:00
parent b289f29948
commit 1923f4486b
3 changed files with 5 additions and 5 deletions

View File

@ -67,7 +67,7 @@ final class MultiStaticSelect extends Element
return $this;
}
public function initial_options(array $initial=NULL): self
public function initial_options(Collection $initial=NULL): self
{
// No initial options.
if (count($initial)) {
@ -77,7 +77,7 @@ final class MultiStaticSelect extends Element
if (count($initial) > self::MAX_OPTIONS)
throw new SlackSyntaxException(sprintf('Can only have maximum %d options',self::MAX_OPTIONS));
$this->initial_options = $this->options->filter(function($item) use ($initial) { return in_array($item['value'],$initial); });
$this->initial_options = $this->options->filter(function($item) use ($initial) { return $initial->contains($item['value']); });
}
return $this;

View File

@ -89,7 +89,7 @@ final class Modal extends BlockKit
return $this;
}
public function clear_on_close(bool $bool): self
public function clear_on_close(bool $bool=TRUE): self
{
if ($this->type != 'modal')
throw new SlackSyntaxException(sprintf('clear_on_close is not required for %s',$this->type));
@ -136,7 +136,7 @@ final class Modal extends BlockKit
return $this;
}
public function notify_on_close(bool $bool): self
public function notify_on_close(bool $bool=TRUE): self
{
if ($this->type != 'modal')
throw new SlackSyntaxException(sprintf('notify_on_close is not required for %s',$this->type));

View File

@ -20,7 +20,7 @@ class BlockActionListener //implements ShouldQueue
{
protected const LOGKEY = 'LBA';
public $queue = 'slack';
// public $queue = 'slack';
/**
* Handle the event.