diff --git a/src/UserAction/BasicExecutor.php b/src/UserAction/BasicExecutor.php index e41e349227..e3fa706b6a 100644 --- a/src/UserAction/BasicExecutor.php +++ b/src/UserAction/BasicExecutor.php @@ -45,7 +45,7 @@ class BasicExecutor extends View implements ExecutorInterface /** @var array list of validated arguments */ protected $validArguments = []; - /** @var JsExpressionable|\Closure JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ + /** @var JsExpressionable|\Closure($this, T): ?JsBlock JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ protected $jsSuccess; #[\Override] diff --git a/src/UserAction/ConfirmationExecutor.php b/src/UserAction/ConfirmationExecutor.php index 470b7cae21..7a2a1f4629 100644 --- a/src/UserAction/ConfirmationExecutor.php +++ b/src/UserAction/ConfirmationExecutor.php @@ -29,7 +29,7 @@ class ConfirmationExecutor extends Modal implements JsExecutorInterface /** @var UserAction|null Action to execute */ public $action; - /** @var JsExpressionable|\Closure JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ + /** @var JsExpressionable|\Closure($this, T, mixed, mixed): ?JsBlock JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ public $jsSuccess; /** @var string CSS class for modal size. */ @@ -180,7 +180,7 @@ protected function doFinal(View $modal): void protected function jsGetExecute($obj, $id): JsBlock { $success = $this->jsSuccess instanceof \Closure - ? ($this->jsSuccess)($this, $this->action->getModel(), $id) + ? ($this->jsSuccess)($this, $this->action->getModel(), $id, $obj) : $this->jsSuccess; return new JsBlock([ diff --git a/src/UserAction/JsCallbackExecutor.php b/src/UserAction/JsCallbackExecutor.php index c016707d9f..0c346a61ec 100644 --- a/src/UserAction/JsCallbackExecutor.php +++ b/src/UserAction/JsCallbackExecutor.php @@ -34,7 +34,7 @@ class JsCallbackExecutor extends JsCallback implements ExecutorInterface /** @var Model\UserAction The model user action */ public $action; - /** @var JsExpressionable|\Closure JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ + /** @var JsExpressionable|\Closure($this, T, mixed, mixed): ?JsBlock JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ public $jsSuccess; #[\Override] diff --git a/src/UserAction/StepExecutorTrait.php b/src/UserAction/StepExecutorTrait.php index cdcdb365ae..340d0560fe 100644 --- a/src/UserAction/StepExecutorTrait.php +++ b/src/UserAction/StepExecutorTrait.php @@ -44,7 +44,7 @@ trait StepExecutorTrait /** @var bool */ protected $actionInitialized = false; - /** @var JsExpressionable|\Closure JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ + /** @var JsExpressionable|\Closure($this, T, mixed, mixed): ?JsBlock JS expression to return if action was successful, e.g "new JsToast('Thank you')" */ public $jsSuccess; /** @var array A seed for creating form in order to edit arguments/fields user entry. */