Skip to content

Commit

Permalink
Update HtmxComponent.php
Browse files Browse the repository at this point in the history
  • Loading branch information
zunnu committed Jul 22, 2024
1 parent 178e729 commit fcaaca2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Controller/Component/HtmxComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function beforeRender($event): void
*/
public function afterRender($event)
{
if(!empty($this->block) && $event->getSubject()->exists($this->block)) {
if (!empty($this->block) && $event->getSubject()->exists($this->block)) {
$block = $event->getSubject()->fetch($this->block);
$event->getSubject()->assign('content', $block);
}
Expand Down Expand Up @@ -324,7 +324,7 @@ public function clientRefresh(): ?Response
* @param array $headers The headers that will be set
* @return \Cake\Http\Response|null
*/
public function stopPolling($content = '', array $headers = []): ?Response
public function stopPolling(string $content = '', array $headers = []): ?Response
{
$response = $this->getController()->getResponse();

Expand Down Expand Up @@ -360,10 +360,10 @@ private function encodeTriggers(array $triggers): string

/**
* Set a specific block to render
*
* @param null|string $block Name of the block
*
* @param string|null $block Name of the block
*/
public function setBlock($block): static
public function setBlock(?string $block): static
{
$this->block = $block;

Expand All @@ -372,8 +372,8 @@ public function setBlock($block): static

/**
* Get the block that will be rendered
*
* @return null|string
*
* @return string|null
*/
public function getBlock(): ?string
{
Expand Down

0 comments on commit fcaaca2

Please sign in to comment.