Skip to content

Commit a33de34

Browse files
author
Artem Stepin
committed
fixed phpstan issues
1 parent dbbec5b commit a33de34

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/Entity/AbstractContent.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ public function getSpace(): ?string
9090
}
9191

9292
/**
93-
* @param string $space
93+
* @param string|null $space
9494
* @return self
9595
*/
96-
public function setSpace(string $space): self
96+
public function setSpace(?string $space): self
9797
{
9898
$this->space = $space;
9999
return $this;
@@ -181,9 +181,7 @@ public function createComment(string $comment): ContentComment
181181
$contentComment->setContainerId($this->getId());
182182
$contentComment->setContainerType($this->getType());
183183
$contentComment->setContent($comment);
184-
if ($this->getSpace()) {
185-
$contentComment->setSpace($this->getSpace());
186-
}
184+
$contentComment->setSpace($this->getSpace());
187185
return $contentComment;
188186
}
189187

@@ -195,13 +193,11 @@ public function createComment(string $comment): ContentComment
195193
public function createSubpage(string $title, string $body): ContentPage
196194
{
197195
$contentPage = new ContentPage();
198-
if ($this->id) {
199-
$contentPage->addAncestor($this->id);
200-
}
201196
$contentPage->setContent($body);
202197
$contentPage->setTitle($title);
203-
if ($this->getSpace()) {
204-
$contentPage->setSpace($this->getSpace());
198+
$contentPage->setSpace($this->getSpace());
199+
if ($this->id) {
200+
$contentPage->addAncestor($this->id);
205201
}
206202
return $contentPage;
207203
}

0 commit comments

Comments
 (0)