Changeset 888 for trunk/Modules


Ignore:
Timestamp:
Nov 24, 2020, 10:58:56 AM (4 years ago)
Author:
chronos
Message:
  • Modified: More static types added.
Location:
trunk/Modules
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Chat/irc_bot.php

    r887 r888  
    55class IRCBot
    66{
    7   var $OwnerName = 'Chronosův';
    8   var $Server = "game.zdechov.net";
    9   var $Port = 6667;
    10   var $Channel = "#zdechov";
    11   var $Nick = "History";
    12   var $JokeFileName = "jokes.txt";
    13   var $File;
     7  public string $OwnerName = 'Chronosův';
     8  public string $Server = "game.zdechov.net";
     9  public int $Port = 6667;
     10  public string $Channel = "#zdechov";
     11  public string $Nick = "History";
     12  public string $JokeFileName = "jokes.txt";
     13  public $File;
    1414
    1515  function __construct()
  • trunk/Modules/EmailQueue/EmailQueue.php

    r887 r888  
    7878  }
    7979
    80   function AddItem($To, $Subject, $Content, $From, $AttachmentFileId = '')
     80  function AddItem(string $To, string $Subject, string $Content, string $From, string $AttachmentFileId = ''): void
    8181  {
    8282    $Values = array('To' => $To,
  • trunk/Modules/Finance/Bill.php

    r887 r888  
    66  public bool $Checked = false;
    77
    8   function GenerateHTML()
     8  function GenerateHTML(): string
    99  {
    1010    return '';
    1111  }
    1212
    13   function SaveToFile(string $FileName)
     13  function SaveToFile(string $FileName): void
    1414  {
    1515    $PdfData = $this->HtmlToPdf($this->GenerateHTML());
  • trunk/Modules/Finance/Finance.php

    r887 r888  
    2222class Finance extends Model
    2323{
    24   var $kWh;
    25   var $Internet;
    26   var $Sprava;
    27   var $DatumOdecteni;
    28   var $InternetUsers;
    29   var $SpravaUsers;
    30   var $MaxSpeed;
    31   var $RealMaxSpeed;
    32   var $SpeedReserve;
    33   var $BaseSpeedElement;
    34   var $BaseTariffPrice;
    35   var $TopTariffPrice;
    36   var $TotalPaid;
    37   var $TotalInternetPaid;
    38   var $MainSubject;
    39   var $BillingPeriods;
    40   var $DirectoryId;
    41   var $Rounding;
     24  public string $kWh;
     25  public string $Internet;
     26  public string $Sprava;
     27  public string $DatumOdecteni;
     28  public string $InternetUsers;
     29  public string $SpravaUsers;
     30  public string $MaxSpeed;
     31  public string $RealMaxSpeed;
     32  public string $SpeedReserve;
     33  public string $BaseSpeedElement;
     34  public string $BaseTariffPrice;
     35  public string $TopTariffPrice;
     36  public string $TotalPaid;
     37  public string $TotalInternetPaid;
     38  public string $MainSubject;
     39  public array $BillingPeriods;
     40  public string $DirectoryId;
     41  public string $Rounding;
    4242
    4343  function LoadMonthParameters(int $Period = 1) // 0 - now, 1 - next month
     
    8383  }
    8484
    85   function CreateFinanceYear($Year)
     85  function CreateFinanceYear(int $Year)
    8686  {
    8787    $StartTime = mktime(0, 0, 0, 1, 1, $Year);
     
    100100  }
    101101
    102   function GetFinanceYear(int $Year)
     102  function GetFinanceYear(int $Year): array
    103103  {
    104104    if ($Year == 0)
     
    121121  }
    122122
    123   function GetNextDocumentLineNumber(string $Id, int $FinanceYear = 0)
     123  function GetNextDocumentLineNumber(string $Id, int $FinanceYear = 0): string
    124124  {
    125125          $FinanceYear = $this->GetFinanceYear($FinanceYear);
  • trunk/Modules/Finance/Import.php

    r887 r888  
    128128  }
    129129
    130   function InsertMoney(string $Subject, string $Value, string $Cash, string $Taxable, string $Time, string $Text, array $Group)
     130  function InsertMoney(string $Subject, string $Value, string $Cash, string $Taxable, string $Time, string $Text, array $Group): void
    131131  {
    132132    $Year = date('Y', $Time);
  • trunk/Modules/Finance/Trade.php

    r887 r888  
    33class PageFinanceTaxFiling extends Page
    44{
    5   var $StartEvidence = 0;
     5  public int $StartEvidence = 0;
    66
    77  function __construct(System $System)
     
    1313  }
    1414
    15   function GetTimePeriodBalance($StartTime, $EndTime)
     15  function GetTimePeriodBalance(int $StartTime, int $EndTime): array
    1616  {
    1717    $Balance = array();
     
    7373  }
    7474
    75   function ShowAnnualBalance()
     75  function ShowAnnualBalance(): string
    7676  {
    7777    $Output = '<table style="font-size: smaller;" class="WideTable">';
     
    109109  }
    110110
    111   function ShowMonthlyBalance()
     111  function ShowMonthlyBalance(): string
    112112  {
    113113    $Output = '<table class="WideTable" style="font-size: smaller;">';
     
    151151  }
    152152
    153   function ShowIncomes()
     153  function ShowIncomes(): string
    154154  {
    155155    $Table = array('Ne', 'Ano');
     
    190190  }
    191191
    192   function ShowExpenses()
     192  function ShowExpenses(): string
    193193  {
    194194    $Table = array('Ne', 'Ano');
     
    231231  }
    232232
    233   function ShowClaims()
     233  function ShowClaims(): string
    234234  {
    235235    $Table = array('Ne', 'Ano');
     
    262262  }
    263263
    264   function ShowLiabilities()
     264  function ShowLiabilities(): string
    265265  {
    266266    $Table = array('Ne', 'Ano');
     
    294294  }
    295295
    296   function ShowSubjectList()
     296  function ShowSubjectList(): string
    297297  {
    298298    $Output = '<strong>Seznam subjektů</strong>';
     
    327327  }
    328328
    329   function ShowSmallAssets()
     329  function ShowSmallAssets(): string
    330330  {
    331331    $Output = '<strong>Drobný majetek</strong>';
     
    343343  }
    344344
    345   function ShowSubjectAccount()
     345  function ShowSubjectAccount(): string
    346346  {
    347347    $Finance = &ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance;
     
    408408  }
    409409
    410   function ShowDefault()
     410  function ShowDefault(): string
    411411  {
    412412    $Output = '<strong>Celkové přehledy</strong><br/>';
     
    486486  }
    487487
    488   function ShowFinanceYears()
     488  function ShowFinanceYears(): string
    489489  {
    490490    $Output = 'Roky: ';
     
    499499  {
    500500    $TimeDue = $Time + 15 * 24 * 3600; // 15 dnů
    501 
    502501  }
    503502
  • trunk/Modules/Finance/UserState.php

    r887 r888  
    1111  }
    1212
    13   function ShowFinanceOperation($Subject)
     13  function ShowFinanceOperation(int $Subject): string
    1414  {
    1515    $UserOperationTableQuery = '((SELECT `Text`, `Time`, `Value`, `File`, `BillCode`, NULL AS `PeriodFrom`, NULL AS `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` '.
  • trunk/Modules/FinanceBankAPI/FioAPI.php

    r887 r888  
    55include('GPC.php');
    66
    7 function RemoveComma($Text)
     7function RemoveComma(string $Text): string
    88{
    99  if ((mb_strlen($Text) >= 2) and ($Text[0] == '"') and (mb_substr($Text, -1, 1) == '"')) return mb_substr($Text, 1, -1);
     
    1313class FioAPI
    1414{
    15   var $Token;
    16   var $Encoding;
    17   var $Format;
     15  public string $Token;
     16  public string $Encoding;
     17  public string $Format;
    1818
    1919  function __construct()
  • trunk/Modules/IS/IS.php

    r887 r888  
    845845class ModuleIS extends AppModule
    846846{
    847   var $DashboardItems;
     847  public array $DashboardItems;
    848848
    849849  function __construct(System $System)
  • trunk/Modules/Log/Log.php

    r887 r888  
    6767    $Count = 100;
    6868
    69     $Output = '';
    7069    $Items = array();
    7170    if (array_key_exists('type', $_GET)) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"';
  • trunk/Modules/Map/MapAPI.php

    r887 r888  
    1818  public int $Zoom;
    1919  public string $Key;
    20   var $OnClickObject;
     20  public $OnClickObject;
    2121  public string $MarkerText;
    2222  public array $Markers;
  • trunk/Modules/Meals/Meals.php

    r887 r888  
    33class PageEatingPlace extends Page
    44{
    5   var $DayNames = array('Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota');
    6   var $DayNamesShort = array('NE', 'PO', 'ÚT', 'ST', 'ČT', 'PÁ', 'SO');
    7   var $Status = array('Nezveřejněno', 'Otevřeno', 'Zavřeno - svátek', 'Zavřeno - dovolená');
    8   var $DayCount = 20;    // počet dopředu zobrazených dnů
     5  public array $DayNames = array('Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota');
     6  public array $DayNamesShort = array('NE', 'PO', 'ÚT', 'ST', 'ČT', 'PÁ', 'SO');
     7  public array $Status = array('Nezveřejněno', 'Otevřeno', 'Zavřeno - svátek', 'Zavřeno - dovolená');
     8  public int $DayCount = 20;    // počet dopředu zobrazených dnů
    99
    1010  function __construct(System $System)
  • trunk/Modules/Meteostation/Meteostation.php

    r887 r888  
    2121class MeteoStation extends Model
    2222{
    23   var $Id;
    24   var $Name;
    25   var $Period;
    26   var $URL;
     23  public int $Id;
     24  public string $Name;
     25  public int $Period;
     26  public string $URL;
    2727
    2828  function DownloadData(): void
     
    5454  }
    5555
    56   function CreateImage($FileName): void
     56  function CreateImage(string $FileName): void
    5757  {
    5858    $Image = new Image();
     
    7979class ModuleMeteoStation extends AppModule
    8080{
    81   var $Data;
    82 
    8381  function __construct(System $System)
    8482  {
  • trunk/Modules/NetworkConfig/NetworkConfig.php

    r887 r888  
    33class ModuleNetworkConfig extends AppModule
    44{
    5   var $ConfigItems;
     5  public array $ConfigItems;
    66
    77  function __construct(System $System)
  • trunk/Modules/NetworkConfigAirOS/Generators/SSHClient.php

    r874 r888  
    33class SSHClient
    44{
    5   var $SSHPath;
    6   var $Timeout;
    7   var $HostName;
    8   var $UserName;
    9   var $Password;
    10   var $PrivateKey;
    11   var $Debug;
     5  public string $SSHPath;
     6  public int $Timeout;
     7  public string $HostName;
     8  public string $UserName;
     9  public string $Password;
     10  public string $PrivateKey;
     11  public bool $Debug;
    1212
    1313  function __construct($HostName = 'localhost', $UserName = 'admin', $Password = '')
     
    2222  }
    2323
    24   function Execute($Commands)
     24  function Execute(string $Commands): array
    2525  {
    2626    $Commands = trim($Commands);
     
    3737      $Output = array();
    3838      exec($Command, $Output);
    39     } else $Output = '';
     39    } else $Output = array();
    4040    if ($this->Debug) print_r($Output);
    4141    return $Output;
  • trunk/Modules/NetworkConfigRouterOS/Routerboard.php

    r887 r888  
    33class Routerboard
    44{
    5   var $SSHPath = '/usr/bin/ssh';
    6   var $Timeout = 3;
    7   var $HostName;
    8   var $UserName;
    9   var $Password;
    10   var $PrivateKey = '~/.ssh/id_rsa';
    11   var $MaxBurstLineCount = 100;
    12   var $Debug = false;
     5  public string $SSHPath = '/usr/bin/ssh';
     6  public int $Timeout = 3;
     7  public string $HostName;
     8  public string $UserName;
     9  public string $Password;
     10  public string $PrivateKey = '~/.ssh/id_rsa';
     11  public int $MaxBurstLineCount = 100;
     12  public bool $Debug = false;
    1313
    1414  function __construct($HostName = 'localhost', $UserName = 'admin', $Password = '')
     
    1919  }
    2020
    21   function Execute(array $Commands): array
     21  function Execute($Commands): array
    2222  {
    2323    $Output = array();
     
    7575      if (count($ResultLineParts) > 1)
    7676      {
    77         if ($ResultLineParts[1]{0} == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes
     77        if ($ResultLineParts[1][0] == '"') $ResultLineParts[1] = substr($ResultLineParts[1], 1, -1); // Remove quotes
    7878        $List[substr($ResultLineParts[0], 0, -1)] = $ResultLineParts[1];
    7979      } else $List[substr($ResultLineParts[0], 0, -1)] = '';
     
    116116  }
    117117
    118   function ListGetPrint($Path, $Properties, $Conditions = array()): array
     118  function ListGetPrint(array $Path, array $Properties, array $Conditions = array()): array
    119119  {
    120120    $ConditionList = '';
  • trunk/Modules/NetworkConfigRouterOS/Routerboard2.php

    r887 r888  
    55class Routerboard extends SSH
    66{
    7   var $Methods = array(
     7  public array $Methods = array(
    88    'kex' => 'diffie-hellman-group1-sha1',
    99    'client_to_server' => array('crypt' => '3des-cbc', 'comp' => 'none'),
     
    1111  );
    1212
    13   function Execute($Commands): array
     13  function Execute(array $Commands): array
    1414  {
    1515    if (is_array($Commands)) $Commands = implode(';', $Commands);
  • trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php

    r887 r888  
    33class RouterosAPI
    44{
    5   var $ErrorNo;           // Variable for storing connection error number, if any
    6   var $ErrorStr;          // Variable for storing connection error text, if any
    7   var $Attempts;       // Connection attempt count
    8   var $Connected;  // Connection state
    9   var $Delay;          // Delay between connection attempts in seconds
    10   var $Port;        // Port to connect to
    11   var $Timeout;        // Connection attempt timeout and data read timeout
    12   var $Socket;             // Variable for storing socket resource
    13   var $Debug;
    14   var $SSL; // If SSL API connection is used. You need also change port to 8729
     5  public int $ErrorNo;           // Variable for storing connection error number, if any
     6  public string $ErrorStr;          // Variable for storing connection error text, if any
     7  public int $Attempts;       // Connection attempt count
     8  public bool $Connected;  // Connection state
     9  public int $Delay;          // Delay between connection attempts in seconds
     10  public int $Port;        // Port to connect to
     11  public int $Timeout;        // Connection attempt timeout and data read timeout
     12  public int $Socket;             // Variable for storing socket resource
     13  public bool $Debug;
     14  public bool $SSL; // If SSL API connection is used. You need also change port to 8729
    1515
    1616  function __construct()
  • trunk/Modules/NetworkConfigRouterOS/SSH.php

    r874 r888  
    33class SSH
    44{
    5   var $HostName;
    6   var $UserName;
    7   var $Password;
    8   var $Methods;
     5  public string $HostName;
     6  public string $UserName;
     7  public string $Password;
     8  public array $Methods;
    99
    1010  function __construct($HostName = 'localhost', $UserName = 'admin', $Password = '')
     
    1313    $this->UserName = $UserName;
    1414    $this->Password = $Password;
     15    $this->Methods = array();
    1516  }
    1617
    17   function Execute($Commands)
     18  function Execute(array $Commands): array
    1819  {
    1920    echo($Commands);
  • trunk/Modules/NetworkShare/SharePage.php

    r887 r888  
    33class SharePage extends Page
    44{
    5   var $Dependencies = array('Log');
    6   var $MaxNesting = 20; // Maximální vnoření
    7   var $Promene = array( // Automatické zapamatování proměnných
     5  public array $Dependencies = array('Log');
     6  public int $MaxNesting = 20; // Maximální vnoření
     7  public array $Promene = array( // Automatické zapamatování proměnných
    88    'keyword' => '',
    99    'file_type' => 0,
     
    2525  }
    2626
    27   function ShowTime()
     27  function ShowTime(): string
    2828  {
    2929    return date("H:i:s")."<br />\n";
     
    4040
    4141    // Najde cestu ke keřenu
    42   function PlnaCesta($Row)
     42  function PlnaCesta($Row): string
    4343  {
    4444    // Vyhledání cesty
     
    6060
    6161  // Převede velikost v bajtech na odpovídající jednotky
    62   function PrevedVelikost($Velikost)
     62  function PrevedVelikost($Velikost): string
    6363  {
    6464    $Jednotky = array('B','kB','MB','GB','TB','PB','EB');
  • trunk/Modules/NetworkTopology/NetworkTopology.php

    r887 r888  
    33class PageNetworkTopology extends Page
    44{
    5   var $TopHostName = 'NIX-ROUTER';
     5  public string $TopHostName = 'NIX-ROUTER';
    66
    77  function __construct(System $System)
     
    2323  }
    2424
    25   function ShowImage()
     25  function ShowImage(): string
    2626  {
    2727    $this->SimplePage = true;
     
    117117  }
    118118
    119   function ShowOverview()
     119  function ShowOverview(): string
    120120  {
    121121    $Output = '<img src="topologie.png"><br/>
  • trunk/Modules/TimeMeasure/Graph.php

    r887 r888  
    33class PageGraph extends Page
    44{
    5   var $FontSize;
    6   var $FontFileName;
    7   var $ValueToImageHeigthCoefficient;
    8   var $DefaultWidth;
    9   var $DefaultHeight;
     5  public int $FontSize;
     6  public string $FontFileName;
     7  public float $ValueToImageHeigthCoefficient;
     8  public int $DefaultWidth;
     9  public int $DefaultHeight;
    1010
    1111  function __construct(System $System)
  • trunk/Modules/TimeMeasure/Measure.php

    r874 r888  
    33class Measure extends Model
    44{
    5   var $Data;
    6   var $LevelReducing = 5;
    7   var $ReferenceTime = 0;
    8   var $MaxLevel = 4;
    9   var $Differential = 0;
    10   var $Debug = 0;
    11   var $DivisionCount = 500;
    12   var $ValueTypes = array('Min', 'Avg', 'Max');
    13 
    14   function Load($Id)
     5  public array $Data;
     6  public int $LevelReducing = 5;
     7  public int $ReferenceTime = 0;
     8  public int $MaxLevel = 4;
     9  public int $Differential = 0;
     10  public int $Debug = 0;
     11  public int $DivisionCount = 500;
     12  public array $ValueTypes = array('Min', 'Avg', 'Max');
     13
     14  function Load(int $Id): void
    1515  {
    1616    $Result = $this->Database->select('Measure', '*', 'Id='.$Id);
     
    2828  }
    2929
    30   function StatTableName($Level)
     30  function StatTableName(int $Level): string
    3131  {
    3232    if ($Level == 0) return 'Data';
     
    419419    // Load measures
    420420    $Measures = array();
    421     $Result = $Database->select('Measure', '*');
     421    $Result = $this->Database->select('Measure', '*');
    422422    while ($Row = $Result->fetch_assoc())
    423423    {
    424       $Measures = new Measure();
     424      $Measure = new Measure($this->System);
    425425      $Measure->Load($Row['Id']);
    426426    }
Note: See TracChangeset for help on using the changeset viewer.