Skip to content
Permalink
Browse files

ran php syntax fixer

  • Loading branch information...
matsubo committed Jun 3, 2013
1 parent e9f3745 commit b736d39754f576f86b6eb6a42f7cb2b27dc32b8d
Showing with 13 additions and 20 deletions.
  1. +1 −0 .gitignore
  2. +3 −1 composer.json
  3. +0 −8 sample/usecase.php
  4. +9 −10 src/Matsubo/Redis/Ranking.php
  5. +0 −1 tests/RankingTest.php
@@ -2,3 +2,4 @@ vendor
composer.lock
composer.phar
clover.xml
build
@@ -23,7 +23,9 @@
"require-dev": {
"devster/ubench": "1.1.*-dev",
"phpunit/phpunit": "3.7.*@stable",
"satooshi/php-coveralls": "dev-master"
"satooshi/php-coveralls": "dev-master",
"fabpot/php-cs-fixer": "0.3.*@dev",
"sebastian/diff": "1.0.*@dev"
},
"autoload": {
"psr-0": {"Matsubo": "src/"}
@@ -3,13 +3,11 @@
use Matsubo\Redis\Ranking;
$redis = new \Redis();
$redis->connect('127.0.0.1', 6379);
$ranking = new Ranking($key = 'usecase', $redis);
// Add score
$ranking->setUserScore('kanako', 1);
$ranking->setUserScore('ayaka', 50);
@@ -20,13 +18,11 @@
var_dump($ranking->getScore('ayaka')); // float(50)
var_dump($ranking->getScore('shiori')); // float(100)
// get rank
var_dump($ranking->getRank('kanako')); // int(0)
var_dump($ranking->getRank('ayaka')); // int(1)
var_dump($ranking->getRank('shiori')); // int(2)
/*
* Show top 2
array(3) {
@@ -37,9 +33,5 @@
*/
var_dump($ranking->getRange(0, 1, true));
// Cleanup
$redis->del($key);
@@ -85,8 +85,8 @@ public function incrementScore($user_id, $score_diff)
/**
* getRange
*
* @param int $start
* @param int $end
* @param int $start
* @param int $end
* @param bool $withscores
* @access public
* @return array
@@ -98,8 +98,8 @@ public function getRange($start = 0, $end = -1, $withscores = false)
/**
* getRevRange
*
* @param int $start
* @param int $end
* @param int $start
* @param int $end
* @param bool $withscores
* @access public
* @return array
@@ -111,11 +111,11 @@ public function getRevRange($start = 0, $end = -1, $withscores = false)
/**
* getRangeByScores
*
* @param int $start
* @param int $end
* @param int $start
* @param int $end
* @param bool $withscores
* @param int $offset
* @param int $count
* @param int $offset
* @param int $count
* @access public
* @return array
*/
@@ -153,6 +153,7 @@ public function deleteAllUser()
$this->redis->zDelete($this->namespace, $user_id);
$deleted_user_id[] = $user_id;
}
return $deleted_user_id;
}
/**
@@ -166,5 +167,3 @@ public function countUsers()
return $this->redis->zSize($this->namespace);
}
}
@@ -32,7 +32,6 @@ public function userProvider()
return $data;
}
/**
* setUp
*

0 comments on commit b736d39

Please sign in to comment.
You can’t perform that action at this time.