Skip to content

Commit

Permalink
rename Callback::terminateJsonIfCanTerminate() method
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Mar 27, 2024
1 parent 1d26954 commit 414b48b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function set($fx = null, $fxArgs = null)
/**
* Terminate this callback by rendering the given view.
*/
public function terminateJson(View $view): void
public function terminateJsonIfCanTerminate(View $view): void
{
if ($this->canTerminate()) {
$this->getApp()->terminateJson($view);
Expand Down
3 changes: 2 additions & 1 deletion src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ public function set($fx = null)

$this->cb->set(function () use ($fx) {
$fx($this);
$this->cb->terminateJson($this->getShimIfOwner());

$this->cb->terminateJsonIfCanTerminate($this->getShimIfOwner());
});

return $this;
Expand Down
3 changes: 2 additions & 1 deletion src/Modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public function enableCallback(): void

$this->cb->set(function () {
($this->fx)($this->cbView);
$this->cb->terminateJson($this->cbView);

$this->cb->terminateJsonIfCanTerminate($this->cbView);
});
}

Expand Down
3 changes: 2 additions & 1 deletion src/Panel/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public function onLoad(\Closure $fx): void
{
$this->cb->set(function () use ($fx) {
$fx($this);
$this->cb->terminateJson($this);

$this->cb->terminateJsonIfCanTerminate($this);
});
}

Expand Down
5 changes: 2 additions & 3 deletions src/Popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ public function set($fx = null)

$fx($content);

Check failure on line 152 in src/Popup.php

View workflow job for this annotation

GitHub Actions / Smoke (latest, StaticAnalysis)

Parameter #1 $ of closure expects Atk4\Ui\View, Atk4\Ui\AbstractView given.

// only render our content view
// PopupService will replace content with this one
$this->cb->terminateJson($content);
// only render our content view, PopupService will replace content with this one
$this->cb->terminateJsonIfCanTerminate($content);

Check failure on line 155 in src/Popup.php

View workflow job for this annotation

GitHub Actions / Smoke (latest, StaticAnalysis)

Parameter #1 $view of method Atk4\Ui\Callback::terminateJsonIfCanTerminate() expects Atk4\Ui\View, Atk4\Ui\AbstractView given.
});

return $this;
Expand Down

0 comments on commit 414b48b

Please sign in to comment.