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/Meteostation/Meteostation.php

    r874 r887  
    33class PageMeteo extends Page
    44{
    5   var $FullTitle = 'Stav meteostanice';
    6   var $ShortTitle = 'Meteostanice';
    7   var $ParentClass = 'PagePortal';
     5  function __construct(System $System)
     6  {
     7    parent::__construct($System);
     8    $this->FullTitle = 'Stav meteostanice';
     9    $this->ShortTitle = 'Meteostanice';
     10    $this->ParentClass = 'PagePortal';
     11  }
    812
    9   function Show()
     13  function Show(): string
    1014  {
    1115    $Output = 'Stav meteostanice:<br/>';
     
    2226  var $URL;
    2327
    24   function DownloadData()
     28  function DownloadData(): void
    2529  {
    2630    $XmlData = simplexml_load_file($this->URL);
     
    5054  }
    5155
    52   function CreateImage($FileName)
     56  function CreateImage($FileName): void
    5357  {
    5458    $Image = new Image();
     
    6367  }
    6468
    65   function LoadFromDb()
     69  function LoadFromDb(): void
    6670  {
    6771    $DbResult = $this->Database->select('Meteostation', '*', 'Id = '.$this->Id);
     
    7781  var $Data;
    7882
    79   function __construct($System)
     83  function __construct(System $System)
    8084  {
    8185    parent::__construct($System);
     
    8892  }
    8993
    90   function DownloadAll()
     94  function DownloadAll(): void
    9195  {
    9296    $DbResult = $this->Database->select('MeteoStation', '*');
    9397    while ($DbRow = $DbResult->fetch_assoc())
    9498    {
    95       $MeteoStation = new MeteoStation();
     99      $MeteoStation = new MeteoStation($this->System);
    96100      $MeteoStation->Id = $DbRow['Id'];
    97101      $MeteoStation->LoadFromDb();
     
    102106
    103107
    104   function DoInstall()
     108  function DoInstall(): void
    105109  {
    106110  }
    107111
    108   function DoUninstall()
     112  function DoUninstall(): void
    109113  {
    110114  }
    111115
    112   function DoStart()
     116  function DoStart(): void
    113117  {
    114     $this->System->RegisterPage('meteo', 'PageMeteo');
     118    $this->System->RegisterPage(['meteo'], 'PageMeteo');
    115119  }
    116120
    117   function DoStop()
     121  function DoStop(): void
    118122  {
    119123  }
Note: See TracChangeset for help on using the changeset viewer.