Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
API: FIx PhpStan error
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Dec 16, 2020
1 parent 99cbec4 commit 6572608
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Api/StaticPageEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,15 @@ public function actionDetail(int $id): void
return;
}

$parent = $staticPage->getParent();
$this->sendJson([
'item' => [
'id' => $staticPage->getId(),
'title' => $staticPage->getTitle(),
'content' => $staticPage->getContent(),
'parent' => $staticPage->getParent() ? [
'id' => $staticPage->getParent()->getId(),
'title' => $staticPage->getParent()->getTitle(),
'parent' => $parent !== null ? [
'id' => $parent->getId(),
'title' => $parent->getTitle(),
] : null,

'active' => $staticPage->isActive(),
Expand Down

0 comments on commit 6572608

Please sign in to comment.