r91816 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91815‎ | r91816 | r91817 >
Date:06:45, 10 July 2011
Author:ialex
Status:ok
Tags:
Comment:
Stylised ParserOptions.php
Modified paths:
  • /trunk/phase3/includes/parser/ParserOptions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/ParserOptions.php
@@ -17,7 +17,7 @@
1818 var $mInterwikiMagic; # Interlanguage links are removed and returned in an array
1919 var $mAllowExternalImages; # Allow external images inline
2020 var $mAllowExternalImagesFrom; # If not, any exception?
21 - var $mEnableImageWhitelist; # If not or it doesn't match, should we check an on-wiki whitelist?
 21+ var $mEnableImageWhitelist; # If not or it doesn't match, should we check an on-wiki whitelist?
2222 var $mDateFormat = null; # Date format index
2323 var $mEditSection = true; # Create "edit section" links
2424 var $mAllowSpecialInclusion; # Allow inclusion of special pages
@@ -61,7 +61,7 @@
6262 function getAllowExternalImagesFrom() { return $this->mAllowExternalImagesFrom; }
6363 function getEnableImageWhitelist() { return $this->mEnableImageWhitelist; }
6464 function getEditSection() { return $this->mEditSection; }
65 - function getNumberHeadings() { $this->optionUsed('numberheadings');
 65+ function getNumberHeadings() { $this->optionUsed( 'numberheadings' );
6666 return $this->mNumberHeadings; }
6767 function getAllowSpecialInclusion() { return $this->mAllowSpecialInclusion; }
6868 function getTidy() { return $this->mTidy; }
@@ -76,32 +76,32 @@
7777 function getEnableLimitReport() { return $this->mEnableLimitReport; }
7878 function getCleanSignatures() { return $this->mCleanSignatures; }
7979 function getExternalLinkTarget() { return $this->mExternalLinkTarget; }
80 - function getMath() { $this->optionUsed('math');
 80+ function getMath() { $this->optionUsed( 'math' );
8181 return $this->mMath; }
82 - function getThumbSize() { $this->optionUsed('thumbsize');
 82+ function getThumbSize() { $this->optionUsed( 'thumbsize' );
8383 return $this->mThumbSize; }
84 - function getStubThreshold() { $this->optionUsed('stubthreshold');
 84+ function getStubThreshold() { $this->optionUsed( 'stubthreshold' );
8585 return $this->mStubThreshold; }
8686
8787 function getIsPreview() { return $this->mIsPreview; }
8888 function getIsSectionPreview() { return $this->mIsSectionPreview; }
89 - function getIsPrintable() { $this->optionUsed('printable');
 89+ function getIsPrintable() { $this->optionUsed( 'printable' );
9090 return $this->mIsPrintable; }
9191 function getUser() { return $this->mUser; }
9292 function getPreSaveTransform() { return $this->mPreSaveTransform; }
9393
94 - /**
95 - * @param $title Title
96 - * @return Skin
 94+ /**
 95+ * @param $title Title
 96+ * @return Skin
9797 * @deprecated since 1.18 Use Linker::* instead
98 - */
99 - function getSkin( $title = null ) {
 98+ */
 99+ function getSkin( $title = null ) {
100100 wfDeprecated( __METHOD__ );
101101 return new DummyLinker;
102102 }
103103
104104 function getDateFormat() {
105 - $this->optionUsed('dateformat');
 105+ $this->optionUsed( 'dateformat' );
106106 if ( !isset( $this->mDateFormat ) ) {
107107 $this->mDateFormat = $this->mUser->getDatePreference();
108108 }
@@ -123,7 +123,7 @@
124124 * @since 1.17
125125 */
126126 function getUserLang() {
127 - $this->optionUsed('userlang');
 127+ $this->optionUsed( 'userlang' );
128128 return $this->mUserLang;
129129 }
130130
@@ -136,9 +136,9 @@
137137 function setEditSection( $x ) { return wfSetVar( $this->mEditSection, $x ); }
138138 function setNumberHeadings( $x ) { return wfSetVar( $this->mNumberHeadings, $x ); }
139139 function setAllowSpecialInclusion( $x ) { return wfSetVar( $this->mAllowSpecialInclusion, $x ); }
140 - function setTidy( $x ) { return wfSetVar( $this->mTidy, $x); }
 140+ function setTidy( $x ) { return wfSetVar( $this->mTidy, $x ); }
141141 function setSkin( $x ) { $this->mSkin = $x; }
142 - function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x); }
 142+ function setInterfaceMessage( $x ) { return wfSetVar( $this->mInterfaceMessage, $x ); }
143143 function setTargetLanguage( $x ) { return wfSetVar( $this->mTargetLanguage, $x, true ); }
144144 function setMaxIncludeSize( $x ) { return wfSetVar( $this->mMaxIncludeSize, $x ); }
145145 function setMaxPPNodeCount( $x ) { return wfSetVar( $this->mMaxPPNodeCount, $x ); }
@@ -281,37 +281,43 @@
282282
283283 $confstr = '';
284284
285 - if ( in_array( 'math', $forOptions ) )
 285+ if ( in_array( 'math', $forOptions ) ) {
286286 $confstr .= $this->mMath;
287 - else
 287+ } else {
288288 $confstr .= '*';
 289+ }
289290
290291
291292 // Space assigned for the stubthreshold but unused
292293 // since it disables the parser cache, its value will always
293294 // be 0 when this function is called by parsercache.
294 - if ( in_array( 'stubthreshold', $forOptions ) )
 295+ if ( in_array( 'stubthreshold', $forOptions ) ) {
295296 $confstr .= '!' . $this->mStubThreshold;
296 - else
 297+ } else {
297298 $confstr .= '!*' ;
 299+ }
298300
299 - if ( in_array( 'dateformat', $forOptions ) )
 301+ if ( in_array( 'dateformat', $forOptions ) ) {
300302 $confstr .= '!' . $this->getDateFormat();
 303+ }
301304
302 - if ( in_array( 'numberheadings', $forOptions ) )
 305+ if ( in_array( 'numberheadings', $forOptions ) ) {
303306 $confstr .= '!' . ( $this->mNumberHeadings ? '1' : '' );
304 - else
 307+ } else {
305308 $confstr .= '!*';
 309+ }
306310
307 - if ( in_array( 'userlang', $forOptions ) )
 311+ if ( in_array( 'userlang', $forOptions ) ) {
308312 $confstr .= '!' . $this->mUserLang;
309 - else
 313+ } else {
310314 $confstr .= '!*';
 315+ }
311316
312 - if ( in_array( 'thumbsize', $forOptions ) )
 317+ if ( in_array( 'thumbsize', $forOptions ) ) {
313318 $confstr .= '!' . $this->mThumbSize;
314 - else
 319+ } else {
315320 $confstr .= '!*';
 321+ }
316322
317323 // add in language specific options, if any
318324 // @todo FIXME: This is just a way of retrieving the url/user preferred variant
@@ -324,9 +330,10 @@
325331 } elseif ( !$this->mEditSection ) {
326332 $confstr .= '!edit=0';
327333 }
328 -
329 - if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) )
 334+
 335+ if ( $this->mIsPrintable && in_array( 'printable', $forOptions ) ) {
330336 $confstr .= '!printable=1';
 337+ }
331338
332339 if ( $this->mExtraKey != '' )
333340 $confstr .= $this->mExtraKey;

Status & tagging log