Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Dec 8, 2021
1 parent ded2017 commit f02dfb7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Expand Up @@ -51,6 +51,9 @@ private function split(string $mainContent): void
$this->splitContentToParts();
}

/**
* @psalm-suppress RedundantCast
*/
private function splitContentToParts(): void
{
$parsedContent = explode('<!--break-->', $this->content);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Entity/PageInterface.php
Expand Up @@ -38,7 +38,7 @@ public function getParentPage(): ?self;
public function setParentPage(?self $page): self;

/**
* @return PageInterface[]|Collection<int, PageInterface>|array
* @return Collection<int, PageInterface>
*/
public function getChildrenPages();

Expand Down
7 changes: 4 additions & 3 deletions packages/core/src/Entity/PageTrait/PageParentTrait.php
Expand Up @@ -2,6 +2,7 @@

namespace Pushword\Core\Entity\PageTrait;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use LogicException;
Expand All @@ -19,7 +20,7 @@ trait PageParentTrait
* @ORM\OneToMany(targetEntity="Pushword\Core\Entity\PageInterface", mappedBy="parentPage")
* @ORM\OrderBy({"publishedAt": "DESC", "priority": "DESC"})
*
* @var PageInterface[]|Collection<int, PageInterface>|null
* @var Collection<int, PageInterface>
*/
protected $childrenPages;

Expand Down Expand Up @@ -50,11 +51,11 @@ public function setParentPage(?PageInterface $page): self
}

/**
* @return PageInterface[]|Collection<int, PageInterface>|array
* @return Collection<int, PageInterface>
*/
public function getChildrenPages()
{
return null !== $this->childrenPages ? $this->childrenPages : [];
return null !== $this->childrenPages ? $this->childrenPages : new ArrayCollection([]);
}

public function hasChildrenPages(): bool
Expand Down
2 changes: 1 addition & 1 deletion packages/flat/src/FlatFileExportCommand.php
Expand Up @@ -36,7 +36,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('Export will start in few seconds...');

if ('' !== $input->getArgument('exportDir')) {
$this->exporter->setExportDir($input->getArgument('exportDir')); // @phpstan-ignore-line
$this->exporter->setExportDir($input->getArgument('exportDir'));
}

$exportDir = $this->exporter->run($input->getArgument('host'));
Expand Down

0 comments on commit f02dfb7

Please sign in to comment.