diff --git a/src/lib/views/wiki/WikiPageHistoryView.php b/src/lib/views/wiki/WikiPageHistoryView.php index b689ece..93f5341 100644 --- a/src/lib/views/wiki/WikiPageHistoryView.php +++ b/src/lib/views/wiki/WikiPageHistoryView.php @@ -31,11 +31,11 @@ * @uses WikiRevisionHistoryView * * @param WikiPageObject $page The wiki page to display - * @param array $revisions The revisions to display + * @param Collection $revisions The revisions to display * @param string $action The action to take * @param int $priority The priority of the view */ - public function __construct(WikiPageObject $page, array $revisions, $action = null, $priority = 0) { + public function __construct(WikiPageObject $page, Collection $revisions, $action = null, $priority = 0) { parent::__construct($page, $action, $priority); $this->addView(new WikiRevisionHistoryView($revisions, 1)); diff --git a/src/lib/views/wiki/WikiRevisionHistoryView.php b/src/lib/views/wiki/WikiRevisionHistoryView.php index 5276c46..5da8051 100644 --- a/src/lib/views/wiki/WikiRevisionHistoryView.php +++ b/src/lib/views/wiki/WikiRevisionHistoryView.php @@ -23,9 +23,7 @@ class WikiRevisionHistoryView extends PanaceaView { /** - * Array of {@link WikiHistory}s - * - * @var array + * @var WikiHistoryCollection */ protected $revisions; @@ -35,12 +33,16 @@ * @author Tommy Montgomery * @since 2008-10-21 * - * @param array $revisions The revisions to display - * @param int $priority The priority of the view + * @param Collection $revisions The revisions to display + * @param int $priority The priority of the view */ - public function __construct(array $revisions, $priority = 0) { + public function __construct(Collection $revisions, $priority = 0) { parent::__construct($priority); + if ($revisions->type !== 'WikiHistory') { + throw new InvalidTypeException(1, 'Collection with type "WikiHistory"', $revisions); + } + $this->revisions = $revisions; } @@ -66,7 +68,7 @@ foreach ($this->revisions as $revision => $history) { ?>