Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (4 years ago)
Author:
chronos
Message:
  • Added: Static types added to almost all classes, methods and function. Supported by PHP 7.4.
  • Fixed: Various found code issues.
Location:
trunk/Modules/NetworkConfigLinux/Generators
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigLinux/Generators/CheckPorts.php

    r874 r887  
    33class ConfigCheckPorts extends NetworkConfigItem
    44{
    5   function CheckPortStatus($IP, $Port, $Protocol = 'tcp')
     5  function CheckPortStatus($IP, $Port, $Protocol = 'tcp'): int
    66  {
    77    $Timeout = 1;
     
    1717    return $State;
    1818  }
    19  
    20   function CheckPorts()
     19
     20  function CheckPorts(): void
    2121  {
    2222    $StartTime = time();
     
    7777  }
    7878
    79   function Run()
     79  function Run(): void
    8080  {
    8181    RepeatFunction(60, array($this, 'CheckPorts'));
  • trunk/Modules/NetworkConfigLinux/Generators/DNS.php

    r873 r887  
    77class ConfigDNS extends NetworkConfigItem
    88{
    9   function GenerateDNS($DNS)
     9  function GenerateDNS(array $DNS): void
    1010  {
    1111    $Output = '$ORIGIN '.$DNS['Domain'].'.'."\n".
     
    147147  }
    148148
    149   function Run()
     149  function Run(): void
    150150  {
    151151    $BaseDomain = 'zdechov.net';
  • trunk/Modules/NetworkConfigLinux/Generators/Latency.php

    r873 r887  
    33class ConfigLatency extends NetworkConfigItem
    44{
    5   function PingHosts()
     5  function PingHosts(): void
    66  {
    77    $Timeout = 2000; // ms
     
    2323
    2424    $Queries = array();
    25     foreach ($Output as $Index => $Line) 
     25    foreach ($Output as $Index => $Line)
    2626    {
    2727      $IP = substr($Line, 0, strPos($Line, ' '));
     
    3535  }
    3636
    37   function Run()
     37  function Run(): void
    3838  {
    3939    RepeatFunction(10 * 60, array($this, 'PingHosts'));
Note: See TracChangeset for help on using the changeset viewer.