From 2f6591febe47169ae1698b0080880e6e75d3af3f Mon Sep 17 00:00:00 2001 From: kaldari Date: Thu, 1 Aug 2013 17:52:47 -0700 Subject: [PATCH] Making title-params no longer required. In theory, a notification could not need any contextual information so there's no reason we should make it required. Now, if the title-params are not provided in the notifcation definition, it just sets the value to an empty array. Change-Id: Iba5ce5cc56010101c5e64976c95b37a215dc99fa --- formatters/BasicFormatter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/formatters/BasicFormatter.php b/formatters/BasicFormatter.php index 3eaa97a3b..70c3e20ff 100644 --- a/formatters/BasicFormatter.php +++ b/formatters/BasicFormatter.php @@ -41,8 +41,7 @@ class EchoBasicFormatter extends EchoNotificationFormatter { * @param array */ protected $requiredParameters = array ( - 'title-message', - 'title-params' + 'title-message' ); /** @@ -57,15 +56,15 @@ class EchoBasicFormatter extends EchoNotificationFormatter { public function __construct( $params ) { parent::__construct( $params ); + // Set up default params if any are missing + $params += $this->getDefaultParams(); + // Title for archive page $this->title = array( 'message' => $params['title-message'], 'params' => $params['title-params'] ); - // Set up default params if one is missing - $params += $this->getDefaultParams(); - // Title for the flyout $this->flyoutTitle = array( 'message' => $params['flyout-message'], @@ -108,6 +107,7 @@ class EchoBasicFormatter extends EchoNotificationFormatter { */ protected function getDefaultParams() { return array( + 'title-params' => array(), 'flyout-message' => $this->title['message'], 'flyout-params' => $this->title['params'], 'bundle-message' => '',