Skip to content

Commit

Permalink
Fixed incorrect type-hinting of Form DTO BookmarkRemoveData
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Dec 27, 2024
1 parent 33f9c0e commit 8d8bd8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/bundle/Controller/BookmarkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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<int, false>
*/
private function getChoices(array $bookmarks): array
{
Expand Down
10 changes: 5 additions & 5 deletions src/lib/Form/Data/Bookmark/BookmarkRemoveData.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@
class BookmarkRemoveData
{
/**
* @var array
* @var array<int, false>
*/
#[Assert\NotBlank]
public $bookmarks;
public array $bookmarks;

/**
* @param array $bookmarks
* @param array<int, false> $bookmarks
*/
public function __construct(array $bookmarks = [])
{
$this->bookmarks = $bookmarks;
}

/**
* @return array
* @return array<int, false>
*/
public function getBookmarks(): array
{
return $this->bookmarks;
}

/**
* @param array $bookmarks
* @param array<int, false> $bookmarks
*/
public function setBookmarks(array $bookmarks): void
{
Expand Down

0 comments on commit 8d8bd8c

Please sign in to comment.