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

    r874 r887  
    55class Fio
    66{
    7   var $UserName;
    8   var $Password;
    9   var $Account;
     7  public string $UserName;
     8  public string $Password;
     9  public int $Account;
    1010
    11   function Import($TimeFrom, $TimeTo)
     11  function Import(int $TimeFrom, int $TimeTo): array
    1212  {
    1313    if ($this->UserName == '') throw new Exception('Missing value for UserName property.');
     
    5959  }
    6060
    61   function NoValidDataError($Response)
     61  function NoValidDataError(array $Response): void
    6262  {
    6363    // Try to get error message
    64     // If something go wrong fio show HTML login page and display error message
    65   $Response = implode('', $Response);
     64    // If something go wrong fio shows HTML login page and display error message
     65    $Response = implode('', $Response);
    6666    $ErrorMessageStart = '<div id="oldform_warning">';
    6767    if (strpos($Response, $ErrorMessageStart) !== false)
    68   {
    69     $Response = substr($Response, strpos($Response, $ErrorMessageStart) + strlen($ErrorMessageStart));
    70     $ErrorMessage = trim(substr($Response, 0, strpos($Response, '</div>')));
    71   } else $ErrorMessage = '';
    72   throw new Exception('No valid GPC data: '.$ErrorMessage);
     68    {
     69      $Response = substr($Response, strpos($Response, $ErrorMessageStart) + strlen($ErrorMessageStart));
     70      $ErrorMessage = trim(substr($Response, 0, strpos($Response, '</div>')));
     71    } else $ErrorMessage = '';
     72    throw new Exception('No valid GPC data: '.$ErrorMessage);
    7373  }
    7474}
Note: See TracChangeset for help on using the changeset viewer.