watcheditem: Fix bad $options param in NoWriteWatchedItemStore::countWatchersMultiple
authorUmherirrender <umherirrender_de.wp@web.de>
Sat, 29 Jun 2019 21:33:36 +0000 (23:33 +0200)
committerKrinkle <krinklemail@gmail.com>
Sun, 8 Sep 2019 04:00:09 +0000 (04:00 +0000)
countVisitingWatchersMultiple is documented to take int|null as second
parameter, but array is given here. The options array is documented to
have a minimumWatchers key, so fix it by using that key.

Caught by PhanTypeMismatchArgument, to be enabled with I34d65fe3ff191.

Change-Id: I0271edae3442fc1adafabf623beeb7f2c4411d6c

includes/watcheditem/NoWriteWatchedItemStore.php

index 72f6086..69dcec8 100644 (file)
@@ -57,7 +57,10 @@ class NoWriteWatchedItemStore implements WatchedItemStoreInterface {
        }
 
        public function countWatchersMultiple( array $targets, array $options = [] ) {
-               return $this->actualStore->countVisitingWatchersMultiple( $targets, $options );
+               return $this->actualStore->countVisitingWatchersMultiple(
+                       $targets,
+                       $options['minimumWatchers'] ?? null
+               );
        }
 
        public function countVisitingWatchersMultiple(