Skip to content

Commit

Permalink
Fix navigation builder parameter types (pimcore#16304)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdreesen authored Dec 6, 2023
1 parent 16b0447 commit 09d7411
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions lib/Navigation/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ class Builder

/**
* @internal
*
*/
protected ?string $htmlMenuIdPrefix = null;

/**
* @internal
*
*/
protected string $pageClass = DocumentPage::class;

Expand Down Expand Up @@ -76,8 +74,8 @@ protected function configureOptions(OptionsResolver $options): void

$options->setAllowedTypes('root', [Document::class, 'null']);
$options->setAllowedTypes('htmlMenuPrefix', ['string', 'null']);
$options->setAllowedTypes('pageCallback', ['callable', 'null']);
$options->setAllowedTypes('rootCallback', ['callable', 'null']);
$options->setAllowedTypes('pageCallback', [\Closure::class, 'null']);
$options->setAllowedTypes('rootCallback', [\Closure::class, 'null']);
$options->setAllowedTypes('cache', ['string', 'bool']);
$options->setAllowedTypes('cacheLifetime', ['int', 'null']);
$options->setAllowedTypes('maxDepth', ['int', 'null']);
Expand All @@ -94,8 +92,8 @@ protected function resolveOptions(array $options): array
* @param array{
* root?: ?Document,
* htmlMenuPrefix?: ?string,
* pageCallback?: ?callable,
* rootCallback?: ?callable,
* pageCallback?: ?\Closure,
* rootCallback?: ?\Closure,
* cache?: string|bool,
* cacheLifetime?: ?int,
* maxDepth?: ?int,
Expand Down Expand Up @@ -184,8 +182,6 @@ public function getNavigation(array $params): Container

/**
* @internal
*
*
*/
protected function markActiveTrail(Container $navigation, ?Document $activeDocument): void
{
Expand Down Expand Up @@ -272,7 +268,6 @@ protected function findActivePages(Container $navigation, string $property, stri
}

/**
*
* @throws \Exception
*
* @internal
Expand Down Expand Up @@ -316,15 +311,13 @@ public function setPageClass(string $pageClass): static

/**
* Returns the name of the pageclass
*
*/
public function getPageClass(): string
{
return $this->pageClass;
}

/**
*
* @return Document[]
*/
protected function getChildren(Document $parentDocument): array
Expand All @@ -339,7 +332,6 @@ protected function getChildren(Document $parentDocument): array
}

/**
*
* @return Page[]
*
* @throws \Exception
Expand Down

0 comments on commit 09d7411

Please sign in to comment.