* No effective change. Only code reformatting.
* Logically group related members.
* Break up items one per line in getHash().
Change-Id: I8ccbe9d071a5c39f5c3d36d0d990574fb0ed8d72
protected $resourceLoader;
protected $request;
- protected $modules;
- protected $language;
- protected $direction;
+
+ // Module content vary
protected $skin;
- protected $user;
+ protected $language;
protected $debug;
+ protected $user;
+
+ // Request vary (in addition to cache vary)
+ protected $modules;
protected $only;
protected $version;
- protected $hash;
protected $raw;
protected $image;
protected $variant;
protected $format;
+
+ protected $direction;
+ protected $hash;
protected $userObj;
protected $imageObj;
public function getHash() {
if ( !isset( $this->hash ) ) {
$this->hash = implode( '|', array(
- $this->getLanguage(), $this->getSkin(), $this->getUser(),
- $this->getImage(), $this->getVariant(), $this->getFormat(),
- $this->getDebug(), $this->getOnly(), $this->getVersion()
+ // Module content vary
+ $this->getLanguage(),
+ $this->getSkin(),
+ $this->getDebug(),
+ $this->getUser(),
+ // Request vary
+ $this->getOnly(),
+ $this->getVersion(),
+ $this->getImage(),
+ $this->getVariant(),
+ $this->getFormat(),
) );
}
return $this->hash;
$this->assertEquals( $derived->getModules(), array( 'test.context' ) );
$this->assertEquals( $derived->getOnly(), 'scripts' );
$this->assertEquals( $derived->getSkin(), 'fallback' );
- $this->assertEquals( $derived->getHash(), 'zh|fallback||||||scripts|' );
+ $this->assertEquals( $derived->getHash(), 'zh|fallback|||scripts||||' );
}
public function testSetLanguage() {
$derived->setLanguage( 'nl' );
// Assert that subclass is able to clear parent class "hash" member
- $this->assertEquals( $derived->getHash(), 'nl|fallback||||||scripts|' );
+ $this->assertEquals( $derived->getHash(), 'nl|fallback|||scripts||||' );
}
}