Fix subclassing of CssContent and JavaScriptContent
authorKunal Mehta <legoktm@gmail.com>
Sat, 13 Sep 2014 22:31:18 +0000 (15:31 -0700)
committerKunal Mehta <legoktm@gmail.com>
Sat, 13 Sep 2014 22:31:18 +0000 (15:31 -0700)
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
includes/content/JavaScriptContent.php

index 7241458..8290603 100644 (file)
@@ -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 );
        }
 
        /**
index 0991f07..c0194c2 100644 (file)
@@ -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 );
        }
 
        /**