Ignore:
Timestamp:
Apr 6, 2020, 11:56:19 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Do not use parenthesis around returned value.
Location:
trunk/Modules/TimeMeasure
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/TimeMeasure/Graph.php

    r873 r874  
    2020  {
    2121    $this->ClearPage = true;
    22     return ($this->Render());
     22    return $this->Render();
    2323  }
    2424
  • trunk/Modules/TimeMeasure/Main.php

    r873 r874  
    111111    $Output .= '</form>';
    112112
    113     return ($Output);
     113    return $Output;
    114114  }
    115115
     
    179179
    180180    $Output .= '<br/>'.$this->MeasureTable();
    181     return ($Output);
     181    return $Output;
    182182  }
    183183
     
    191191    $Output .= '<a href="?Measure='.$_SESSION['Measure'].'&amp;TimeStart='.
    192192      $_SESSION['TimeStart'].'&amp;TimeEnd='.$_SESSION['TimeEnd'].'&amp;TimeSpecify=1&amp;Differential='.$_SESSION['Differential'].'">Odkaz na vybraný graf</a><br>';
    193     return ($Output);
     193    return $Output;
    194194  }
    195195
     
    260260    //echo($PrefixMultiplier->Add('-0.000000071112345', 'B'));
    261261    $Output .= '</div>';
    262     return ($Output);
     262    return $Output;
    263263  }
    264264}
     
    271271
    272272    $Output = '';
    273     if (!array_key_exists('MeasureId', $_GET)) return ('Nebylo zadáno Id měření.');
    274     if (!array_key_exists('Value', $_GET)) return ('Nebyla zadána hodnota.');
     273    if (!array_key_exists('MeasureId', $_GET)) return 'Nebylo zadáno Id měření.';
     274    if (!array_key_exists('Value', $_GET)) return 'Nebyla zadána hodnota.';
    275275    $Measure = new Measure($this->System);
    276276    $Measure->Load($_GET['MeasureId']);
    277     if (!isset($Measure->Data['Id'])) return ('Měření s Id '.$_GET['MeasureId'].' nenalezeno.');
     277    if (!isset($Measure->Data['Id'])) return 'Měření s Id '.$_GET['MeasureId'].' nenalezeno.';
    278278    $Measure->AddValue(array('Min' => $_GET['Value'], 'Avg' => $_GET['Value'], 'Max' => $_GET['Value']));
    279     return ($Output);
     279    return $Output;
    280280  }
    281281}
  • trunk/Modules/TimeMeasure/Measure.php

    r873 r874  
    2525  function TimeSegment($Base, $Level)
    2626  {
    27     return (pow($this->LevelReducing, $Level) * $Base);
     27    return pow($this->LevelReducing, $Level) * $Base;
    2828  }
    2929
    3030  function StatTableName($Level)
    3131  {
    32     if ($Level == 0) return ('Data');
    33       else return ('DataCache');
     32    if ($Level == 0) return 'Data';
     33      else return 'DataCache';
    3434  }
    3535
    3636  function AlignTime($Time, $TimeSegment)
    3737  {
    38     return (round(($Time - $this->ReferenceTime) / $TimeSegment) * $TimeSegment + $this->ReferenceTime);
     38    return round(($Time - $this->ReferenceTime) / $TimeSegment) * $TimeSegment + $this->ReferenceTime;
    3939  }
    4040
     
    124124  {
    125125    $Y = ($Y2 - $Y1) / ($X2 - $X1) * ($X - $X1) + $Y1;
    126     return ($Y);
     126    return $Y;
    127127  }
    128128
     
    203203      $NewValue['Avg'] = $NewValue['Avg'] / ($RightTime - $LeftTime);
    204204    }
    205     return ($NewValue);
     205    return $NewValue;
    206206  }
    207207
     
    228228      echo('AbsoluteRightTime: '.$AbsoluteRightTime.'('.TimeToMysqlDateTime($AbsoluteRightTime).')<br>');
    229229    }
    230     return (array('Left' => $AbsoluteLeftTime, 'Right' => $AbsoluteRightTime));
     230    return array('Left' => $AbsoluteLeftTime, 'Right' => $AbsoluteRightTime);
    231231  }
    232232
     
    239239      $Row = $DbResult->fetch_assoc();
    240240      $Row['Time'] = MysqlDateTimeToTime($Row['Time']);
    241       return (array($Row));
     241      return array($Row);
    242242    } else
    243243    {
     
    253253      }
    254254     // if ($Debug) print_r($Result);
    255       return ($Result);
     255      return $Result;
    256256    }
    257257  }
     
    266266      $Row = $DbResult->fetch_assoc();
    267267      $Row['Time'] = MysqlDateTimeToTime($Row['Time']);
    268       return (array($Row));
     268      return array($Row);
    269269    } else
    270270    {
     
    280280        array_push($Result, array('Time' => (MysqlDateTimeToTime($Row['Time']) - 10), 'Min' => 0, 'Avg' => 0, 'Max' => 0, 'Continuity' => 0));
    281281      }
    282       return ($Result);
     282      return $Result;
    283283    }
    284284  }
     
    338338      if ($this->Debug) print_r($Points);
    339339    } else $Points[] = array('Min' => 0, 'Avg' => 0, 'Max' => 0);
    340     return ($Points);
     340    return $Points;
    341341  }
    342342
  • trunk/Modules/TimeMeasure/Measurement/System.php

    r873 r874  
    1414    {
    1515      fclose($Fp1);
    16       return (TRUE);
     16      return TRUE;
    1717    } else
    1818    {
    1919      //echo($ERROR_NO.','.$ERROR_STR);
    20       return (FALSE);
     20      return FALSE;
    2121    }
    2222    restore_error_handler();
     
    3434      $Time = $Parts[7];
    3535      $TimeParts = explode('=', $Time);
    36       return ($TimeParts[1]);
    37     } else return (0);
     36      return $TimeParts[1];
     37    } else return 0;
    3838  }
    3939
     
    4848    while (strpos($Row, '  ') !== false) $Row = str_replace('  ', ' ', $Row);
    4949    $RowParts2 = explode(' ', $Row);
    50     return ($RowParts[2] + $RowParts2[2]);
     50    return $RowParts[2] + $RowParts2[2];
    5151  }
    5252
     
    8181    }
    8282    file_put_contents($CpuStateFileName, serialize($CpuUsage));
    83     return (100 - round($CpuUsagePercent['Idle'], 2));
     83    return 100 - round($CpuUsagePercent['Idle'], 2);
    8484  }
    8585
     
    114114    }
    115115    file_put_contents($NetworkStateFile, serialize($NetworkState));
    116     return ($NetworkState);
     116    return $NetworkState;
    117117  }
    118118
     
    120120  {
    121121    $NetworkState = $this->GetNetworkState();
    122     return ($NetworkState['Interface']['DownAverage']);
     122    return $NetworkState['Interface']['DownAverage'];
    123123  }
    124124
     
    126126  {
    127127    $NetworkState = $this->GetNetworkState();
    128     return ($NetworkState['Interface']['UpAverage']);
     128    return $NetworkState['Interface']['UpAverage'];
    129129  }
    130130
     
    134134    $Output = array();
    135135    exec('cat /proc/net/nf_conntrack|grep "dst='.$HostIP.' "|grep "dport='.$Port.' "|grep "ASSURED"', $Output);
    136     return (count($Output));
     136    return count($Output);
    137137  }
    138138
     
    145145    $Parts = explode(' ', $Row);
    146146    $Value = str_replace(',', '.', $Parts[11]);
    147     return ($Value);
     147    return $Value;
    148148  }
    149149
    150150  function DiskFree($Path)
    151151  {
    152     return (disk_free_space($Path));
     152    return disk_free_space($Path);
    153153  }
    154154
     
    163163        $Line = substr($Line, strpos($Line, '+') + 1);
    164164        $Line = substr($Line, 0, strpos($Line, '°'));
    165         return ($Line);
     165        return $Line;
    166166      }
    167167    }
    168     return (0);
     168    return 0;
    169169  }
    170170
     
    175175    fclose($File);
    176176    $UptimeParts = explode(' ', $Uptime);
    177     return ($UptimeParts[0]);
     177    return $UptimeParts[0];
    178178  }
    179179}
  • trunk/Modules/TimeMeasure/Measurement/WoW.php

    r873 r874  
    1212    $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1');
    1313    $Row = $DbResult->fetch_array();
    14     return ($Row[0]);
     14    return $Row[0];
    1515  }
    1616
     
    2020    $DbResult = $Database->query('SELECT COUNT(*) FROM account WHERE online=1 AND gmlevel > 0');
    2121    $Row = $DbResult->fetch_array();
    22     return ($Row[0]);
     22    return $Row[0];
    2323  }
    2424
     
    2828    $DbResult = $Database->query('SELECT COUNT(*) FROM account');
    2929    $Row = $DbResult->fetch_array();
    30     return ($Row[0]);
     30    return $Row[0];
    3131  }
    3232
     
    3636    $DbResult = $Database->query('SELECT COUNT(*) FROM guild');
    3737    $Row = $DbResult->fetch_array();
    38     return ($Row[0]);
     38    return $Row[0];
    3939  }
    4040
     
    4444    $DbResult = $Database->query('SELECT COUNT(*) FROM `characters`');
    4545    $Row = $DbResult->fetch_array();
    46     return ($Row[0]);
     46    return $Row[0];
    4747  }
    4848
     
    5252    $DbResult = $Database->query('SELECT COUNT(*) FROM uptime');
    5353    $Row = $DbResult->fetch_array();
    54     return ($Row[0]);
     54    return $Row[0];
    5555  }
    5656
    5757  function WoWEmulatorAvailability()
    5858  {
    59     if (CheckPortStatus('localhost', 8085)) return (100); else return (0);
     59    if (CheckPortStatus('localhost', 8085)) return 100;
     60      else return 0;
    6061  }
    6162
     
    6970    $Row = $DbResult->fetch_array();
    7071    $Value = $Row[0];
    71     return ($Value);
     72    return $Value;
    7273  }
    7374}
Note: See TracChangeset for help on using the changeset viewer.