r73468 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73467‎ | r73468 | r73469 >
Date:18:03, 21 September 2010
Author:brion
Status:ok (Comments)
Tags:
Comment:
normalize tabs in QrCode ext
Modified paths:
  • /trunk/extensions/QrCode/QrCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/QrCode/QrCode.php
@@ -17,7 +17,7 @@
1818 */
1919
2020 if ( !defined( 'MEDIAWIKI' ) )
21 - die( 'This is a MediaWiki extension, and must be run from within MediaWiki.' );
 21+ die( 'This is a MediaWiki extension, and must be run from within MediaWiki.' );
2222
2323 $wgExtensionCredits['parserhook'][] = array(
2424 'path' => __FILE__,
@@ -76,7 +76,7 @@
7777 $parser = array_shift($params);
7878
7979 foreach( $params as $pair ) {
80 - $rpms = explode( '=', $pair );
 80+ $rpms = explode( '=', $pair );
8181 if( $rpms[0] == 'ecc' ) $this->_ecc = $rpms[1];
8282 if( $rpms[0] == 'size' ) $this->_size = $rpms[1];
8383 if( $rpms[0] == 'boundary' ) $this->_boundary = $rpms[1];
@@ -126,8 +126,8 @@
127127 * @return user object
128128 * */
129129 private function _getBot(){
130 - global $wgQrCodeBot;
131 -
 130+ global $wgQrCodeBot;
 131+
132132 // there doesn't seem to be a decent method for checking if a user already exists...
133133 $bot = User::createNew( $wgQrCodeBot );
134134 if( $bot != null ){
@@ -139,7 +139,7 @@
140140 $bot->addGroup( 'bot' );
141141
142142 return $bot;
143 - }
 143+ }
144144
145145 /**
146146 * Handle mediawiki file repositories

Comments

#Comment by Clausekwis (talk | contribs)   20:08, 21 September 2010

Well sorry, I didn't know you should use 8 spaces for a tab. The manual says:

Lines should be indented with a single tab character per indenting level. You should make no assumptions about the number of spaces per tab.
Most MediaWiki developers find 4 spaces per tab to be best for readability, but many systems are configured to use 8 spaces per tab.
#Comment by MaxSem (talk | contribs)   20:12, 21 September 2010

> Well sorry, I didn't know you should use 8 spaces for a tab

You shouldn't. Always use tabs and never assume any particular number of spaces they correspond to.

#Comment by Clausekwis (talk | contribs)   20:29, 21 September 2010

I used tabs, not spaces. That's what I said above, I didn't assume, and I do never use space. I just hit tab and my editor is set to tabspace=4. Why is it then changed to 8 later?

Status & tagging log