Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Code style: Max line length, double carriage returns [ci skip]

  • Loading branch information...
commit 50da8fca797845ea232183d8b5a21df718264b3b 1 parent bb647d9
@ginatrapani ginatrapani authored
View
21 tests/TestOfPostMySQLDAO.php
@@ -734,20 +734,24 @@ public function testGetAllMentions() {
public function testgetAllMentionsInRange() {
$dao = new PostMySQLDAO();
$mentions = $dao->getAllMentionsInRange("ev", $count = 200, $network = 'twitter', $from = '2006-03-01 00:00:00',
- $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date", $direction="DESC");
+ $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date",
+ $direction="DESC");
$this->assertEqual($mentions[0]->post_text, "Hey @ev and @jack should fix Twitter - post 9");
$this->assertEqual($mentions[2]->post_text, "Hey @ev and @jack should fix Twitter - post 7");
- $mentions = $dao->getAllMentionsInRange("jack", $count = 200, $network = 'twitter', $from = '2006-03-01 00:00:00',
- $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date", $direction="DESC");
+ $mentions = $dao->getAllMentionsInRange("jack", $count = 200, $network = 'twitter',
+ $from = '2006-03-01 00:00:00',
+ $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date",
+ $direction="DESC");
$this->assertEqual(sizeof($mentions), 10);
// test ascending order
$posts = $dao->getAllMentionsInRange("jack", $count = 200, $network = 'twitter', $from = '2006-02-28 23:59:00',
- $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date", $direction="ASC");
+ $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date",
+ $direction="ASC");
$date = strtotime($posts[0]->pub_date);
foreach($posts as $post) {
@@ -757,13 +761,15 @@ public function testgetAllMentionsInRange() {
// test range with no posts
$posts = $dao->getAllMentionsInRange("jack", $count = 200, $network = 'twitter', $from = '2006-03-01 13:59:00',
- $until = '2006-03-01 15:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date", $direction="DESC");
+ $until = '2006-03-01 15:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date",
+ $direction="DESC");
$this->assertEqual(sizeof($posts), 0);
// test from greater than until
$posts = $dao->getAllMentionsInRange("jack", $count = 200, $network = 'twitter', $from = '2006-03-01 23:59:00',
- $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date", $direction="DESC");
+ $until = '2006-03-01 01:00:00', $page=1, $public=false, $include_rts = true, $order_by="pub_date",
+ $direction="DESC");
$this->assertEqual(sizeof($posts), 0);
}
@@ -1129,7 +1135,8 @@ public function testGetRepliesToPost() {
public function testgetRepliesToPostInRange() {
$dao = new PostMySQLDAO();
// Default Sorting
- $posts = $dao->getRepliesToPostInRange('41', 'twitter', $from = '2006-03-01 00:00:00',$until = '2006-03-02 23:30:59',
+ $posts = $dao->getRepliesToPostInRange('41', 'twitter', $from = '2006-03-01 00:00:00',
+ $until = '2006-03-02 23:30:59',
$order_by="pub_date");
$this->assertEqual(sizeof($posts), 2);
$this->assertEqual($posts[0]->post_text, '@shutterbug Nice shot!', "post reply");
View
21 webapp/_lib/controller/class.PostAPIController.php
@@ -353,7 +353,8 @@ public function control() {
*
* Required arguments: post_id
*
- * Optional arguments: network, order_by, unit, count, page, include_entities, include_replies, trim_user
+ * Optional arguments: network, order_by, unit, count, page, include_entities, include_replies,
+ * trim_user
*
* Docs: http://thinkupapp.com/docs/userguide/api/posts/post_retweets.html
*/
@@ -372,7 +373,8 @@ public function control() {
*
* Required arguments: post_id
*
- * Optional arguments: network, order_by, unit, count, page, include_entities, include_replies, trim_user
+ * Optional arguments: network, order_by, unit, count, page, include_entities, include_replies,
+ * trim_user
*
* Ordering can only be done by either location or follower count.
*
@@ -394,7 +396,8 @@ public function control() {
*
* Required arguments: post_id, from and until
*
- * Optional arguments: network, order_by, unit, count, page, include_entities, include_replies, trim_user
+ * Optional arguments: network, order_by, unit, count, page, include_entities, include_replies,
+ * trim_user
*
* Ordering can only be done by either location or follower count.
*
@@ -405,8 +408,8 @@ public function control() {
$m = 'A request of type ' . $this->type . ' requires a post_id to be specified.';
throw new RequiredArgumentMissingException($m);
} else {
- $data = $this->post_dao->getRepliesToPostInRange($this->post_id, $this->network, $this->from, $this->until, $this->order_by,
- $this->unit, $this->is_public, $this->count, $this->page);
+ $data = $this->post_dao->getRepliesToPostInRange($this->post_id, $this->network, $this->from,
+ $this->until, $this->order_by, $this->unit, $this->is_public, $this->count, $this->page);
}
break;
@@ -554,8 +557,8 @@ public function control() {
* Docs: http://thinkupapp.com/docs/userguide/api/posts/user_questions.html
*/
case 'user_questions_in_range':
- $data = $this->post_dao->getAllQuestionPostsInRange($this->user->user_id, $this->network, $this->count, $this->from, $this->until,
- $this->page, $this->order_by, $this->direction, $this->is_public);
+ $data = $this->post_dao->getAllQuestionPostsInRange($this->user->user_id, $this->network, $this->count,
+ $this->from, $this->until, $this->page, $this->order_by, $this->direction, $this->is_public);
break;
/*
@@ -584,8 +587,8 @@ public function control() {
* http://thinkupapp.com/docs/userguide/api/posts/user_replies.html
*/
case 'user_replies_in_range':
- $data = $this->post_dao->getAllRepliesInRange($this->user->user_id, $this->network, $this->count,$this->from, $this->until,
- $this->page, $this->order_by, $this->direction, $this->is_public);
+ $data = $this->post_dao->getAllRepliesInRange($this->user->user_id, $this->network, $this->count,
+ $this->from, $this->until, $this->page, $this->order_by, $this->direction, $this->is_public);
break;
/*
View
20 webapp/_lib/dao/class.PostMySQLDAO.php
@@ -207,8 +207,8 @@ public function getRepliesToPost($post_id, $network, $order_by = 'default', $uni
return $replies;
}
- public function getRepliesToPostInRange($post_id, $network, $from, $until, $order_by = 'default', $unit = 'km', $is_public = false,
- $count = 350, $page = 1) {
+ public function getRepliesToPostInRange($post_id, $network, $from, $until, $order_by = 'default', $unit = 'km',
+ $is_public = false, $count = 350, $page = 1) {
$start_on_record = ($page - 1) * $count;
$q = "SELECT u.*, p.*, (CASE p.is_geo_encoded WHEN 0 THEN 9 ELSE p.is_geo_encoded END) AS geo_status, ";
@@ -229,17 +229,14 @@ public function getRepliesToPostInRange($post_id, $network, $from, $until, $orde
}
$q .= 'ORDER BY ' . $ordering. ';';
-
$vars = array(
':post_id'=>(string)$post_id,
':network'=>$network,
':user_network'=>($network == 'facebook page') ? 'facebook' : $network,
':from' => $from,
':until' => $until
-
);
-
if ($this->profiler_enabled) Profiler::setDAOMethod(__METHOD__);
$ps = $this->execute($q, $vars);
$all_post_rows = $this->getDataRowsAsArrays($ps);
@@ -986,8 +983,8 @@ public function getAllQuestionPosts($author_id, $network, $count, $page=1, $orde
return $posts;
}
- public function getAllQuestionPostsInRange($author_id, $network, $count, $from, $until, $page=1, $order_by = 'pub_date',
- $direction = 'DESC', $is_public = false) {
+ public function getAllQuestionPostsInRange($author_id, $network, $count, $from, $until, $page=1,
+ $order_by = 'pub_date', $direction = 'DESC', $is_public = false) {
$order_by = $this->sanitizeOrderBy($order_by);
@@ -1012,7 +1009,6 @@ public function getAllQuestionPostsInRange($author_id, $network, $count, $from,
':format2'=>"%\\? %",
':from' => $from,
':until' => $until
-
);
if ($this->profiler_enabled) Profiler::setDAOMethod(__METHOD__);
$ps = $this->execute($q, $vars);
@@ -1457,8 +1453,8 @@ public function getAllMentionsInRange($author_username, $count, $network = "twit
$public, $include_rts, $order_by, $direction);
}
- private function getMentionsInRange($author_username, $count, $network, $from, $until, $iterator, $page=1, $public=false,
- $include_rts = true, $order_by = 'pub_date', $direction = 'DESC') {
+ private function getMentionsInRange($author_username, $count, $network, $from, $until, $iterator, $page=1,
+ $public=false, $include_rts = true, $order_by = 'pub_date', $direction = 'DESC') {
$start_on_record = ($page - 1) * $count;
$order_by = $this->sanitizeOrderBy($order_by);
@@ -1580,8 +1576,8 @@ public function getAllReplies($user_id, $network, $count, $page = 1, $order_by =
return $posts;
}
- public function getAllRepliesInRange($user_id, $network, $count, $from, $until,$page = 1, $order_by = 'pub_date', $direction = 'DESC',
- $is_public = false) {
+ public function getAllRepliesInRange($user_id, $network, $count, $from, $until,$page = 1, $order_by = 'pub_date',
+ $direction = 'DESC', $is_public = false) {
$start_on_record = ($page - 1) * $count;
$order_by = $this->sanitizeOrderBy($order_by);
View
17 webapp/_lib/dao/interface.PostDAO.php
@@ -53,19 +53,18 @@ public function getRepliesToPost($post_id, $network, $order_by = 'default', $uni
$count = 350, $page = 1);
/**
- * Get replies to a post on a given time frame.
+ * Get replies to a post in a given time frame.
* @param str $post_id
* @param str $network
* @param str $order_by Order of sorting posts
* @param int $unit Defaults to km
* @param bool $public Defaults to false
* @param int $count Defaults to 350
- * @param int $page The page of results to return. Defaults to 1. Pages start
- * at 1, not 0.
+ * @param int $page The page of results to return. Defaults to 1. Pages start at 1, not 0.
* @return array Posts with author object set, and optional link object set
*/
- public function getRepliesToPostInRange($post_id, $network, $from, $until, $order_by = 'default', $unit = 'km', $is_public = false,
- $count = 350, $page = 1);
+ public function getRepliesToPostInRange($post_id, $network, $from, $until, $order_by = 'default', $unit = 'km',
+ $is_public = false, $count = 350, $page = 1);
/**
* Get replies Iterator to a post
@@ -373,8 +372,8 @@ public function getAllMentions($author_username, $count, $network = "twitter", $
* to "DESC".
* @return array of Post objects with author and link set
*/
- public function getAllMentionsInRange($author_username, $count, $network = "twitter", $from, $until, $page=1, $public=false,
- $include_rts = true, $order_by = 'pub_date', $direction = 'DESC');
+ public function getAllMentionsInRange($author_username, $count, $network = "twitter", $from, $until, $page=1,
+ $public=false, $include_rts = true, $order_by = 'pub_date', $direction = 'DESC');
/**
* Get all replies to a given user ID
@@ -405,8 +404,8 @@ public function getAllReplies($user_id, $network, $count, $page = 1, $order_by =
* false.
* @return array Posts with author and link set
*/
- public function getAllRepliesInRange($user_id, $network, $count, $from, $until, $page = 1, $order_by = 'pub_date', $direction = 'DESC',
- $is_public = false);
+ public function getAllRepliesInRange($user_id, $network, $count, $from, $until, $page = 1, $order_by = 'pub_date',
+ $direction = 'DESC', $is_public = false);
/**
* Get posts by a user ordered by reply count desc
Please sign in to comment.
Something went wrong with that request. Please try again.