From: Kunal Mehta Date: Sat, 13 Sep 2014 22:31:18 +0000 (-0700) Subject: Fix subclassing of CssContent and JavaScriptContent X-Git-Tag: 1.31.0-rc.0~14038 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=87cddceefe893fc37266487ec18803ad06649edb;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 ); } /**