Ignore:
Timestamp:
Apr 6, 2020, 11:56:19 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Do not use parenthesis around returned value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Database.php

    r873 r874  
    77{
    88  list($usec, $sec) = explode(" ", microtime());
    9   return ((float)$usec + (float)$sec);
     9  return (float)$usec + (float)$sec;
    1010}
    1111
     
    1717  function fetch_assoc()
    1818  {
    19     return ($this->PDOStatement->fetch(PDO::FETCH_ASSOC));
     19    return $this->PDOStatement->fetch(PDO::FETCH_ASSOC);
    2020  }
    2121
    2222  function fetch_array()
    2323  {
    24     return ($this->PDOStatement->fetch(PDO::FETCH_BOTH));
     24    return $this->PDOStatement->fetch(PDO::FETCH_BOTH);
    2525  }
    2626
    2727  function fetch_row()
    2828  {
    29     return ($this->PDOStatement->fetch(PDO::FETCH_NUM));
     29    return $this->PDOStatement->fetch(PDO::FETCH_NUM);
    3030  }
    3131}
     
    8181  function Connected()
    8282  {
    83     return (isset($this->PDO));
     83    return isset($this->PDO);
    8484  }
    8585
     
    119119        throw new Exception('SQL Error: '.$this->Error.', Query: '.$Query);
    120120    }
    121     return ($Result);
     121    return $Result;
    122122  }
    123123
    124124  function select($Table, $What = '*', $Condition = 1)
    125125  {
    126     return ($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition));
     126    return $this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition);
    127127  }
    128128
     
    154154    $Name = substr($Name, 1);
    155155    $Values = substr($Values, 1);
    156     return ('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')');
     156    return 'INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')';
    157157  }
    158158
     
    175175    }
    176176    $Values = substr($Values, 2);
    177     return ('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')');
     177    return 'UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')';
    178178  }
    179179
     
    206206  function real_escape_string($Text)
    207207  {
    208     return (addslashes($Text));
     208    return addslashes($Text);
    209209  }
    210210
    211211  function quote($Text)
    212212  {
    213     return ($this->PDO->quote($Text));
     213    return $this->PDO->quote($Text);
    214214  }
    215215
     
    239239function TimeToMysqlDateTime($Time)
    240240{
    241   if ($Time == NULL) return (NULL);
    242     else return (date('Y-m-d H:i:s', $Time));
     241  if ($Time == NULL) return NULL;
     242    else return date('Y-m-d H:i:s', $Time);
    243243}
    244244
    245245function TimeToMysqlDate($Time)
    246246{
    247   if ($Time == NULL) return (NULL);
    248     else return (date('Y-m-d', $Time));
     247  if ($Time == NULL) return NULL;
     248    else return date('Y-m-d', $Time);
    249249}
    250250
    251251function TimeToMysqlTime($Time)
    252252{
    253   if ($Time == NULL) return (NULL);
    254     else return (date('H:i:s', $Time));
     253  if ($Time == NULL) return NULL;
     254    else return date('H:i:s', $Time);
    255255}
    256256
    257257function MysqlDateTimeToTime($DateTime)
    258258{
    259   if ($DateTime == '') return (NULL);
     259  if ($DateTime == '') return NULL;
    260260  $Parts = explode(' ', $DateTime);
    261261  $DateParts = explode('-', $Parts[0]);
    262262  $TimeParts = explode(':', $Parts[1]);
    263263  $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]);
    264   return ($Result);
     264  return $Result;
    265265}
    266266
    267267function MysqlDateToTime($Date)
    268268{
    269   if ($Date == '') return (NULL);
    270   return (MysqlDateTimeToTime($Date.' 0:0:0'));
     269  if ($Date == '') return NULL;
     270  return MysqlDateTimeToTime($Date.' 0:0:0');
    271271}
    272272
    273273function MysqlTimeToTime($Time)
    274274{
    275   if ($Time == '') return (NULL);
    276   return (MysqlDateTimeToTime('0000-00-00 '.$Time));
    277 }
     275  if ($Time == '') return NULL;
     276  return MysqlDateTimeToTime('0000-00-00 '.$Time);
     277}
Note: See TracChangeset for help on using the changeset viewer.