r84740 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84739‎ | r84740 | r84741 >
Date:11:15, 25 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Remove getFlip code duplication

Move usual one into ResourceLoaderModule, and then move what was in ResourceLoaderModule into ResouceLoaderFileModule
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderModule.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderWikiModule.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoaderUserOptionsModule.php
@@ -111,16 +111,6 @@
112112 return array();
113113 }
114114
115 - /**
116 - * @param $context ResourceLoaderContext
117 - * @return bool
118 - */
119 - public function getFlip( $context ) {
120 - global $wgContLang;
121 -
122 - return $wgContLang->getDir() !== $context->getDirection();
123 - }
124 -
125115 public function getGroup() {
126116 return 'private';
127117 }
Index: trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php
@@ -513,4 +513,13 @@
514514 $style, $dir, $remoteDir, true
515515 );
516516 }
 517+
 518+ /**
 519+ * Get whether CSS for this module should be flipped
 520+ * @param $context ResourceLoaderContext
 521+ * @return bool
 522+ */
 523+ public function getFlip( $context ) {
 524+ return $context->getDirection() === 'rtl';
 525+ }
517526 }
Index: trunk/phase3/includes/resourceloader/ResourceLoaderModule.php
@@ -106,12 +106,13 @@
107107 }
108108
109109 /**
110 - * Get whether CSS for this module should be flipped
111110 * @param $context ResourceLoaderContext
112111 * @return bool
113112 */
114113 public function getFlip( $context ) {
115 - return $context->getDirection() === 'rtl';
 114+ global $wgContLang;
 115+
 116+ return $wgContLang->getDir() !== $context->getDirection();
116117 }
117118
118119 /**
Index: trunk/phase3/includes/resourceloader/ResourceLoaderStartUpModule.php
@@ -226,16 +226,6 @@
227227 }
228228 return $this->modifiedTime[$hash] = $time;
229229 }
230 -
231 - /**
232 - * @param $context ResourceLoaderContext
233 - * @return bool
234 - */
235 - public function getFlip( $context ) {
236 - global $wgContLang;
237 -
238 - return $wgContLang->getDir() !== $context->getDirection();
239 - }
240230
241231 /* Methods */
242232
Index: trunk/phase3/includes/resourceloader/ResourceLoaderWikiModule.php
@@ -131,17 +131,7 @@
132132 public function isKnownEmpty( ResourceLoaderContext $context ) {
133133 return count( $this->getTitleMtimes( $context ) ) == 0;
134134 }
135 -
136 - /**
137 - * @param $context ResourceLoaderContext
138 - * @return bool
139 - */
140 - public function getFlip( $context ) {
141 - global $wgContLang;
142135
143 - return $wgContLang->getDir() !== $context->getDirection();
144 - }
145 -
146136 /**
147137 * Get the modification times of all titles that would be loaded for
148138 * a given context.

Status & tagging log