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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigRouterOS/Generators/Signal.php

    r874 r887  
    33class ConfigRouterOSSignal extends NetworkConfigItem
    44{
    5   function ReadWirelessRegistration()
     5  function ReadWirelessRegistration(): void
    66  {
    77    $Time = time();
     
    6666    $this->Database->Transaction($Queries);
    6767  }
    68  
    69   function StripUnits($Value)
     68
     69  function StripUnits($Value): string
    7070  {
    7171    if (strpos($Value, '-') !== false) $Value = substr($Value, 0, strpos($Value, '-') - 1); // without channel info
    7272    if (substr($Value, -3, 3) == "MHz") $Value = substr($Value, 0, -3); // without MHz unit
    73     if (substr($Value, -4, 4) == "Mbps") $Value = substr($Value, 0, -4); // without Mbps unit   
    74     if (substr($Value, -3, 3) == "Mbp") $Value = substr($Value, 0, -3); // without Mbp unit   
     73    if (substr($Value, -4, 4) == "Mbps") $Value = substr($Value, 0, -4); // without Mbps unit
     74    if (substr($Value, -3, 3) == "Mbp") $Value = substr($Value, 0, -3); // without Mbp unit
    7575    if (substr($Value, -1, 1) == "M") $Value = substr($Value, 0, -1); // without M unit
    7676    return $Value;
    7777  }
    7878
    79   function Run()
     79  function Run(): void
    8080  {
    8181    RepeatFunction(60 * 60, array($this, 'ReadWirelessRegistration'));
Note: See TracChangeset for help on using the changeset viewer.