Skip to content

Commit

Permalink
rename JsCallback::terminateAjaxIfCanTerminate() method
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Mar 31, 2024
1 parent bb84a31 commit 2c4cd47
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Form/Control/Multiline.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,7 @@ private function outputJson(): void
case 'on-change':
$rowsRaw = $this->getApp()->decodeJson($this->getApp()->getRequestPostParam('rows'));
$response = ($this->onChangeFunction)($this->typeCastLoadValues($rowsRaw), $this->form);
$this->renderCallback->terminateAjax($this->renderCallback->getAjaxec($response));
// TODO JsCallback::terminateAjax() should return never
$this->renderCallback->terminateAjaxIfCanTerminate($this->renderCallback->getAjaxec($response));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/JsCallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function set($fx = null, $args = null)

$ajaxec = $this->getAjaxec($response);

$this->terminateAjax($ajaxec);
$this->terminateAjaxIfCanTerminate($ajaxec);
});

return $this;
Expand All @@ -106,7 +106,7 @@ public function set($fx = null, $args = null)
* @param ($success is true ? null : string) $msg General message, typically won't be displayed
* @param bool $success Was request successful or not
*/
public function terminateAjax(JsBlock $ajaxec, $msg = null, bool $success = true): void
public function terminateAjaxIfCanTerminate(JsBlock $ajaxec, $msg = null, bool $success = true): void
{
$data = ['success' => $success];
if (!$success) {
Expand Down
1 change: 0 additions & 1 deletion src/JsSse.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public function send(JsExpressionable $action, bool $success = true): void
/**
* @return never
*/
#[\Override]
public function terminateAjax(JsBlock $ajaxec, $msg = null, bool $success = true): void

Check failure on line 102 in src/JsSse.php

View workflow job for this annotation

GitHub Actions / Smoke (latest, StaticAnalysis)

Method Atk4\Ui\JsSse::terminateAjax() has parameter $msg with no type specified.
{
$ajaxecStr = $ajaxec->jsRender();
Expand Down

0 comments on commit 2c4cd47

Please sign in to comment.