From 8ede0bf20d801f875682d6e969b7722613f3fd5e Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Mon, 14 Dec 2015 10:41:54 -0800 Subject: [PATCH] Add missing @throws tag and change Exception subclass being thrown Change-Id: I39e3cdbdf4bddc12ca2d7d6a2696b92b8b7cbd10 --- includes/formatters/EventPresentationModel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/formatters/EventPresentationModel.php b/includes/formatters/EventPresentationModel.php index 4d2b269fb..931addb6f 100644 --- a/includes/formatters/EventPresentationModel.php +++ b/includes/formatters/EventPresentationModel.php @@ -132,6 +132,7 @@ abstract class EchoEventPresentationModel { * @param bool $includeCurrent Include the current event (and its group) * @param callable $groupCallback Callback that takes an EchoEvent and returns a grouping value * @return int Number of bundled events or groups + * @throws InvalidArgumentException */ final protected function getBundleCount( $includeCurrent = true, $groupCallback = null ) { $events = array_merge( $this->getBundledEvents(), array( $this->event ) ); @@ -140,7 +141,7 @@ abstract class EchoEventPresentationModel { // If we pass an invalid callback to array_map(), it'll just throw a warning // and return NULL, so $count ends up being 0 or -1. Instead of doing that, // throw an exception. - throw new MWException( 'Invalid callback passed to getBundleCount' ); + throw new InvalidArgumentException( 'Invalid callback passed to getBundleCount' ); } $events = array_unique( array_map( $groupCallback, $events ) ); }