r111634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111633‎ | r111634 | r111635 >
Date:12:22, 16 February 2012
Author:maxsem
Status:ok
Tags:
Comment:
Function docs
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFormatter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFormatter.php
@@ -70,6 +70,14 @@
7171
7272 private $itemsToRemove = array();
7373
 74+ /**
 75+ * Constructor
 76+ *
 77+ * @param string $html: Text to process
 78+ * @param Title $title: Title to which $html belongs
 79+ * @param string $format: 'XHTML' or 'WML'
 80+ * @param WmlContext $wmlContext: Context for creation of WML cards, can be omitted if $format == 'XHTML'
 81+ */
7482 public function __construct( $html, $title, $format, WmlContext $wmlContext = null ) {
7583 wfProfileIn( __METHOD__ );
7684
@@ -145,8 +153,7 @@
146154
147155 /**
148156 * Removes content inappropriate for mobile devices
149 - * @global type $wgMFRemovableClasses
150 - * @param type $removeDefaults
 157+ * @param bool $removeDefaults: Whether default settings at self::$defaultItemsToRemove should be used
151158 */
152159 public function filterContent( $removeDefaults = true ) {
153160 global $wgMFRemovableClasses;
@@ -239,6 +246,14 @@
240247 wfProfileOut( __METHOD__ );
241248 }
242249
 250+ /**
 251+ * Performs final transformations to mobile format and returns resulting HTML/WML
 252+ *
 253+ * @param string|bool $id: ID of element to get HTML from or false to get it from the whole tree
 254+ * @param string $prependHtml: HTML to be prepended to result before final transformations
 255+ * @param string $appendHtml: HTML to be appended to result before final transformations
 256+ * @return string: Processed HTML
 257+ */
243258 public function getText( $id = false, $prependHtml = '', $appendHtml = '' ) {
244259 wfProfileIn( __METHOD__ );
245260 if ( $this->mainPage ) {
@@ -271,7 +286,8 @@
272287 }
273288
274289 /**
275 - * @param $matches array
 290+ * Callback for headingTransform()
 291+ * @param array $matches
276292 * @return string
277293 */
278294 private function headingTransformCallbackWML( $matches ) {
@@ -286,7 +302,8 @@
287303 }
288304
289305 /**
290 - * @param $matches array
 306+ * Callback for headingTransform()
 307+ * @param array $matches
291308 * @return string
292309 */
293310 private function headingTransformCallbackXHTML( $matches ) {
@@ -350,8 +367,9 @@
351368 }
352369
353370 /**
354 - * @param $s string
355 - * @return string
 371+ * Creates a WML card from input
 372+ * @param string $s: Raw WML
 373+ * @return string: WML card
356374 */
357375 protected function createWMLCard( $s ) {
358376 wfProfileIn( __METHOD__ );
@@ -406,7 +424,8 @@
407425 }
408426
409427 /**
410 - * @param $s string
 428+ * Prepares headings in WML mode, makes sections expandable in XHTML mode
 429+ * @param string $s
411430 * @return string
412431 */
413432 protected function headingTransform( $s ) {
@@ -449,6 +468,7 @@
450469 }
451470
452471 /**
 472+ * Transforms CSS selectors into an internal representation suitable for processing
453473 * @return array
454474 */
455475 private function parseItemsToRemove() {
@@ -477,7 +497,8 @@
478498 }
479499
480500 /**
481 - * @param DOMDocument $mainPage
 501+ * Performs transformations specific to main page
 502+ * @param DOMDocument $mainPage: Tree to process
482503 * @return DOMElement
483504 */
484505 protected function parseMainPage( DOMDocument $mainPage ) {

Status & tagging log