]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
remove unreachable code
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sun, 25 Oct 2009 20:09:28 +0000 (20:09 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Sun, 25 Oct 2009 20:09:28 +0000 (20:09 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@426 b3834d28-1941-0410-a4f8-b48e95affb8f

src/SemanticScuttle/Service/Vote.php
tests/VoteTest.php

index 086b2a21c7a5c142313dbc2d2a07fcc57f2af9a9..7adf54901d10b974c29a9076f1d33581f977deec 100644 (file)
@@ -34,9 +34,6 @@
  */
 class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
 {
-
-
-
     /**
      * Returns the single service instance
      *
@@ -98,10 +95,6 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
         $row = $this->db->sql_fetchrow($dbres);
         $this->db->sql_freeresult($dbres);
 
-        if (!$row) {
-            return false;
-        }
-
         return (int)$row['sum'];
     }//public function getVoting(..)
 
@@ -117,7 +110,8 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
      */
     public function getVotes($bookmark)
     {
-        $query = 'SELECT COUNT(vote) as count FROM ' . $this->getTableName()
+        $query = 'SELECT COUNT(vote) as count FROM '
+            . $this->getTableName()
             . ' WHERE bid = "' . $this->db->sql_escape($bookmark) . '"';
 
         if (!($dbres = $this->db->sql_query_limit($query, 1, 0))) {
@@ -132,10 +126,6 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
         $row = $this->db->sql_fetchrow($dbres);
         $this->db->sql_freeresult($dbres);
 
-        if (!$row) {
-            return false;
-        }
-
         return (int)$row['count'];
     }
 
@@ -152,7 +142,8 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
      */
     public function hasVoted($bookmark, $user)
     {
-        $query = 'SELECT COUNT(vote) as count FROM ' . $this->getTableName()
+        $query = 'SELECT COUNT(vote) as count FROM '
+            . $this->getTableName()
             . ' WHERE'
             . ' bid = "' . $this->db->sql_escape($bookmark) . '"'
             . ' AND uid = "' . $this->db->sql_escape($user) . '"';
@@ -169,10 +160,6 @@ class SemanticScuttle_Service_Vote extends SemanticScuttle_DbService
         $row = $this->db->sql_fetchrow($dbres);
         $this->db->sql_freeresult($dbres);
 
-        if (!$row) {
-            return null;
-        }
-
         return (int)$row['count'] == 1;
     }
 
index 90611d1f0cf1442a442f7f46c7bd54f10fe6f835..754d9083d467c978776f2babfb90235bd9667861 100644 (file)
@@ -147,7 +147,7 @@ class VoteTest extends TestBase
 
 
     /**
-     * Test getVoting() when several votes have been cast.
+     * Test getVotes() when several votes have been cast.
      *
      * @return void
      */