r93701 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93700‎ | r93701 | r93702 >
Date:01:31, 2 August 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix whitespace and documentation
Modified paths:
  • /trunk/extensions/MobileFrontend/library/WURFL/Storage/Mwmemcache.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/library/WURFL/Storage/Mwmemcache.php
@@ -10,13 +10,21 @@
1111 "expiration" => 0
1212 );
1313
14 - public function __construct($params=array()) {
15 - $currentParams = is_array($params) ? array_merge($this->defaultParams, $params) : $this->defaultParams;
16 - $this->toFields($currentParams);
 14+ /**
 15+ * @param $params array
 16+ */
 17+ public function __construct( $params = array() ) {
 18+ $currentParams = is_array( $params )
 19+ ? array_merge( $this->defaultParams, $params )
 20+ : $this->defaultParams;
 21+ $this->toFields( $currentParams );
1722 }
1823
19 - private function toFields($params) {
20 - foreach($params as $key => $value) {
 24+ /**
 25+ * @param $params array
 26+ */
 27+ private function toFields( $params ) {
 28+ foreach( $params as $key => $value ) {
2129 $this->$key = $value;
2230 }
2331 }
@@ -24,30 +32,27 @@
2533 /**
2634 * Saves the object.
2735 *
28 - * @param string $objectId
29 - * @param mixed $object
30 - * @return
 36+ * @param $objectId string
 37+ * @param $object mixed
 38+ * @return mixed
3139 */
32 - public function save($objectId, $object) {
 40+ public function save( $objectId, $object ) {
3341 global $wgMemc;
3442 return $wgMemc->set( $this->encode( $this->namespace, $objectId ), $object, $this->expiration );
3543 }
3644
37 -
3845 /**
3946 * Load the object.
4047 *
41 - * @param string $objectId
42 - * @param mixed $object
43 - * @return
 48+ * @param $objectId string
 49+ * @return mixed
4450 */
45 - public function load($objectId) {
 51+ public function load( $objectId ) {
4652 global $wgMemc;
4753 $value = $wgMemc->get( $this->encode( $this->namespace, $objectId ) );
4854 return $value ? $value : null; // WURFL expects null on cache miss
4955 }
5056
51 -
5257 public function clear() {
5358 }
5459 }

Status & tagging log