diff --git a/src/bundle/Controller/BookmarkController.php b/src/bundle/Controller/BookmarkController.php index 2aa607e2dd..b1eccec89c 100644 --- a/src/bundle/Controller/BookmarkController.php +++ b/src/bundle/Controller/BookmarkController.php @@ -80,7 +80,7 @@ public function listAction(Request $request): Response ); $removeBookmarkForm = $this->formFactory->removeBookmark( - new BookmarkRemoveData($this->getChoices($pagerfanta->getCurrentPageResults())) + new BookmarkRemoveData($this->getChoices(iterator_to_array($pagerfanta->getCurrentPageResults()))) ); return $this->render( @@ -125,9 +125,9 @@ public function removeAction(Request $request): Response } /** - * @param array $bookmarks + * @param array<\Ibexa\AdminUi\UI\Value\Location\Bookmark> $bookmarks * - * @return array + * @return array */ private function getChoices(array $bookmarks): array { diff --git a/src/lib/Form/Data/Bookmark/BookmarkRemoveData.php b/src/lib/Form/Data/Bookmark/BookmarkRemoveData.php index f5497b57de..65118653ae 100644 --- a/src/lib/Form/Data/Bookmark/BookmarkRemoveData.php +++ b/src/lib/Form/Data/Bookmark/BookmarkRemoveData.php @@ -13,13 +13,13 @@ class BookmarkRemoveData { /** - * @var array + * @var array */ #[Assert\NotBlank] - public $bookmarks; + public array $bookmarks; /** - * @param array $bookmarks + * @param array $bookmarks */ public function __construct(array $bookmarks = []) { @@ -27,7 +27,7 @@ public function __construct(array $bookmarks = []) } /** - * @return array + * @return array */ public function getBookmarks(): array { @@ -35,7 +35,7 @@ public function getBookmarks(): array } /** - * @param array $bookmarks + * @param array $bookmarks */ public function setBookmarks(array $bookmarks): void {