r87291 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87290‎ | r87291 | r87292 >
Date:20:17, 2 May 2011
Author:preilly
Status:ok
Tags:
Comment:
Renamed methods as per our coding standards...
Modified paths:
  • /trunk/extensions/PatchOutputMobile/PatchOutputMobile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PatchOutputMobile/PatchOutputMobile.php
@@ -24,7 +24,7 @@
2525 'onOutputPageBeforeHTML' );
2626
2727 class ExtPatchOutputMobile {
28 - const VERSION = '0.2.2';
 28+ const VERSION = '0.2.3';
2929
3030 private $doc;
3131
@@ -61,11 +61,11 @@
6262 );
6363
6464 public function onOutputPageBeforeHTML( &$out, &$text ) {
65 - ob_start( array( &$this, 'parse' ) );
 65+ ob_start( array( $this, 'parse' ) );
6666 return true;
6767 }
6868
69 - private function _show_hide_callback( $matches ) {
 69+ private function showHideCallback( $matches ) {
7070 static $headings = 0;
7171 $show = 'Show';
7272 $hide = 'Hide';
@@ -95,7 +95,7 @@
9696 // So, using old style for now.
9797 $s = preg_replace_callback(
9898 '/<h2(.*)<span class="mw-headline" [^>]*>(.+)<\/span>\w*<\/h2>/',
99 - array( &$this, '_show_hide_callback' ),
 99+ array( $this, 'showHideCallback' ),
100100 $s
101101 );
102102
@@ -115,13 +115,13 @@
116116 return $this->DOMParse( $s );
117117 }
118118
119 - private function _parse_items_to_remove() {
 119+ private function parseItemsToRemove() {
120120 $item_to_remove_records = array();
121121
122122 foreach ( $this->items_to_remove as $item_to_remove ) {
123123 $type = '';
124124 $raw_name = '';
125 - CSS_detection::detect_id_css_or_tag( $item_to_remove, $type, $raw_name );
 125+ CssDetection::detectIdCssOrTag( $item_to_remove, $type, $raw_name );
126126 $item_to_remove_records[$type][] = $raw_name;
127127 }
128128
@@ -135,7 +135,7 @@
136136 $this->doc->preserveWhiteSpace = false;
137137 $this->doc->strictErrorChecking = false;
138138
139 - $item_to_remove_records = $this->_parse_items_to_remove();
 139+ $item_to_remove_records = $this->parseItemsToRemove();
140140
141141 // Tags
142142
@@ -229,9 +229,9 @@
230230 }
231231 }
232232
233 -class CSS_detection {
 233+class CssDetection {
234234
235 - public static function detect_id_css_or_tag( $snippet, &$type, &$raw_name ) {
 235+ public static function detectIdCssOrTag( $snippet, &$type, &$raw_name ) {
236236 $output = '';
237237
238238 if ( strpos( $snippet, '.' ) === 0 ) {

Status & tagging log