From 87cddceefe893fc37266487ec18803ad06649edb Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Sat, 13 Sep 2014 15:31:18 -0700 Subject: [PATCH] Fix subclassing of CssContent and JavaScriptContent We need to be able to set a different content model via the constructor, so make it an optional parameter. Change-Id: I8b31084e0cfbcca1b3785176eac492d837e0cb0f --- includes/content/CssContent.php | 5 +++-- includes/content/JavaScriptContent.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/content/CssContent.php b/includes/content/CssContent.php index 72414585d0..8290603c1f 100644 --- a/includes/content/CssContent.php +++ b/includes/content/CssContent.php @@ -34,9 +34,10 @@ class CssContent extends TextContent { /** * @param string $text CSS code. + * @param string $modelId the content content model */ - public function __construct( $text ) { - parent::__construct( $text, CONTENT_MODEL_CSS ); + public function __construct( $text, $modelId = CONTENT_MODEL_CSS ) { + parent::__construct( $text, $modelId ); } /** diff --git a/includes/content/JavaScriptContent.php b/includes/content/JavaScriptContent.php index 0991f07683..c0194c2e02 100644 --- a/includes/content/JavaScriptContent.php +++ b/includes/content/JavaScriptContent.php @@ -34,9 +34,10 @@ class JavaScriptContent extends TextContent { /** * @param string $text JavaScript code. + * @param string $modelId the content model name */ - public function __construct( $text ) { - parent::__construct( $text, CONTENT_MODEL_JAVASCRIPT ); + public function __construct( $text, $modelId = CONTENT_MODEL_JAVASCRIPT ) { + parent::__construct( $text, $modelId ); } /** -- 2.20.1