Added docu headers to content(handler) files
[lhc/web/wiklou.git] / includes / content / TextContent.php
index 068b65e..b561b90 100644 (file)
@@ -5,13 +5,37 @@
  *
  * TextContent instances are immutable
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @since 1.21
+ *
+ * @file
+ * @ingroup Content
+ *
+ * @author Daniel Kinzler
  */
-abstract class TextContent extends AbstractContent {
+class TextContent extends AbstractContent {
 
-       public function __construct( $text, $model_id = null ) {
+       public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
                parent::__construct( $model_id );
 
+               if ( !is_string( $text ) ) {
+                       throw new MWException( "TextContent expects a string in the constructor." );
+               }
+
                $this->mText = $text;
        }
 
@@ -57,7 +81,7 @@ abstract class TextContent extends AbstractContent {
                        return false;
                }
 
-               if (  $wgArticleCountMethod === 'any' ) {
+               if ( $wgArticleCountMethod === 'any' ) {
                        return true;
                }
 
@@ -177,4 +201,4 @@ abstract class TextContent extends AbstractContent {
                # TODO: make Highlighter interface, use highlighter here, if available
                return htmlspecialchars( $this->getNativeData() );
        }
-}
\ No newline at end of file
+}