Ignore:
Timestamp:
Nov 20, 2020, 12:08:12 AM (3 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/Error/Error.php

    r873 r887  
    33class ModuleError extends AppModule
    44{
    5   var $Encoding;
    6   var $ShowError;
    7   var $UserErrors;
    8   var $ErrorHandler;
     5  public string $Encoding;
     6  public ErrorHandler $ErrorHandler;
    97
    10   function __construct($System)
     8  function __construct(System $System)
    119  {
    1210    parent::__construct($System);
     
    1917
    2018    $this->ErrorHandler = new ErrorHandler();
     19    $this->Encoding = 'utf-8';
    2120  }
    2221
    23   function DoInstall()
     22  function DoInstall(): void
    2423  {
    2524  }
    2625
    27   function DoUnInstall()
     26  function DoUnInstall(): void
    2827  {
    2928  }
    3029
    31   function DoStart()
     30  function DoStart(): void
    3231  {
    3332    $this->ErrorHandler->ShowError = $this->System->Config['Web']['ShowPHPError'];
     
    3635  }
    3736
    38   function DoStop()
     37  function DoStop(): void
    3938  {
    4039    $this->ErrorHandler->Stop();
    4140  }
    4241
    43   function DoOnError($Error)
     42  function DoOnError(string $Error): void
    4443  {
    45     $this->System->ModuleManager->Modules['Log']->NewRecord('Error', 'Log', $Error);
     44    ModuleLog::Cast($this->System->GetModule('Log'))->NewRecord('Error', 'Log', $Error);
    4645
    4746    //if ($Config['Web']['ErrorLogFile'] != '')
Note: See TracChangeset for help on using the changeset viewer.