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

    r874 r887  
    88class ModuleFinanceBankAPI extends AppModule
    99{
    10   function __construct($System)
     10  function __construct(System $System)
    1111  {
    1212    parent::__construct($System);
     
    1616    $this->License = 'GNU/GPLv3';
    1717    $this->Description = 'Communication through API to various banks, manual file import';
    18     $this->Dependencies = array('Finance', 'Scheduler');
     18    $this->Dependencies = array('Finance', 'Scheduler', 'IS');
    1919  }
    2020
    21   function DoInstall()
     21  function DoInstall(): void
    2222  {
    2323  }
    2424
    25   function DoUninstall()
     25  function DoUninstall(): void
    2626  {
    2727  }
    2828
    29   function DoStart()
     29  function DoStart(): void
    3030  {
    3131    $this->System->FormManager->RegisterClass('ImportBankFile', array(
     
    6060    ));
    6161
    62     $this->System->RegisterPage(array('finance', 'import-api'), 'PageImportAPI');
    63     $this->System->RegisterPage(array('finance', 'import-soubor'), 'PageImportFile');
     62    $this->System->RegisterPage(['finance', 'import-api'], 'PageImportAPI');
     63    $this->System->RegisterPage(['finance', 'import-soubor'], 'PageImportFile');
    6464
    65     $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('FinanceBankAPI',
    66       array('ModuleFinanceBankAPI', 'ShowDashboardItem'));
     65    ModuleIS::Cast($this->System->GetModule('IS'))->RegisterDashboardItem('FinanceBankAPI',
     66      array($this, 'ShowDashboardItem'));
    6767  }
    6868
    69   function DoStop()
     69  function DoStop(): void
    7070  {
    7171  }
    7272
    73   function ShowDashboardItem()
     73  function ShowDashboardItem(): string
    7474  {
    7575    $DbResult = $this->Database->select('FinanceBankImport', 'COUNT(*)', '`FinanceOperation` IS NULL');
     
    7979  }
    8080
    81   function PresetItem($Item)
     81  function PresetItem(array $Item): array
    8282  {
    8383    $Preset = array();
    8484    if ($Item['Value'] < 0) $OperationGroupId = OPERATION_GROUP_ACCOUNT_OUT;
    8585       else $OperationGroupId = OPERATION_GROUP_ACCOUNT_IN;
    86     $FinanceGroup = $this->System->Modules['Finance']->GetFinanceGroupById($OperationGroupId, 'FinanceOperationGroup');
     86    $FinanceGroup = ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance->GetFinanceGroupById($OperationGroupId, 'FinanceOperationGroup');
    8787
    8888    $Preset = array(
     
    100100class ScheduleBankImport extends SchedulerTask
    101101{
    102   function Execute()
     102  function Execute(): string
    103103  {
    104104    $Output = '';
Note: See TracChangeset for help on using the changeset viewer.