Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Action/GetBalance.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\Model\SEPAAccount;
Expand All @@ -25,14 +27,12 @@
class GetBalance extends PaginateableAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
private $account;
/** @var bool */
private $allAccounts;
private SEPAAccount $account;
private bool $allAccounts;

// Response
/** @var HISAL[] */
private $response = [];
private array $response = [];

/**
* @param SEPAAccount $account The account to get the balance for. This can be constructed based on information
Expand Down
14 changes: 6 additions & 8 deletions src/Action/GetDepotAufstellung.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\Model\SEPAAccount;
Expand All @@ -25,18 +27,14 @@
class GetDepotAufstellung extends PaginateableAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
private $account;
private SEPAAccount $account;

// Response
/** @var string */
private $rawMT535 = '';
private string $rawMT535 = '';

/** @var StatementOfHoldings */
private $statement;
private ?StatementOfHoldings $statement = null;

/** @var float */
private $depotWert;
private float $depotWert = 0.0;

/**
* @param SEPAAccount $account The account to get the statement for. This can be constructed based on information
Expand Down
4 changes: 3 additions & 1 deletion src/Action/GetSEPAAccounts.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\Model\SEPAAccount;
Expand Down Expand Up @@ -28,7 +30,7 @@ class GetSEPAAccounts extends PaginateableAction

// Response
/** @var SEPAAccount[] */
private $accounts;
private array $accounts = [];

/**
* @return GetSEPAAccounts A new action instance.
Expand Down
11 changes: 5 additions & 6 deletions src/Action/GetSEPADirectDebitParameters.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\BaseAction;
Expand All @@ -17,12 +19,9 @@ class GetSEPADirectDebitParameters extends BaseAction
public const DIRECT_DEBIT_TYPES = ['CORE', 'COR1', 'B2B'];

// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var string */
private $directDebitType;
/** @var string */
private $seqType;
/** @var bool */
private $singleDirectDebit;
private string $directDebitType;
private string $seqType;
private bool $singleDirectDebit;

/** @var HIDXES */
private $hidxes;
Expand Down
38 changes: 15 additions & 23 deletions src/Action/GetStatementOfAccount.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\CAMT\CAMT;
Expand Down Expand Up @@ -34,45 +36,35 @@
class GetStatementOfAccount extends PaginateableAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
private $account;
/** @var \DateTime */
private $from;
/** @var \DateTime */
private $to;
/** @var bool */
private $allAccounts;
/** @var bool */
private $includeUnbooked;
private SEPAAccount $account;
private ?\DateTimeInterface $from = null;
private ?\DateTimeInterface $to = null;
private bool $allAccounts;
private bool $includeUnbooked;

// Information from the BPD needed to interpret the response.
/** @var string */
private $bankName;
private ?string $bankName = null;

// Internal action for XML fallback
/** @var GetStatementOfAccountXML|null */
private $xmlAction;
private ?GetStatementOfAccountXML $xmlAction = null;

// Response
/** @var string */
private $rawMT940 = '';
private string $rawMT940 = '';

/** @var array */
protected $parsedMT940 = [];
protected array $parsedMT940 = [];

/** @var StatementOfAccount */
private $statement;
private ?StatementOfAccount $statement = null;

/**
* @param SEPAAccount $account The account to get the statement for. This can be constructed based on information
* that the user entered, or it can be {@link SEPAAccount} instance retrieved from {@link getAccounts()}.
* @param \DateTime|null $from If set, only transactions after this date (inclusive) are returned.
* @param \DateTime|null $to If set, only transactions before this date (inclusive) are returned.
* @param \DateTimeInterface|null $from If set, only transactions after this date (inclusive) are returned.
* @param \DateTimeInterface|null $to If set, only transactions before this date (inclusive) are returned.
* @param bool $allAccounts If set to true, will return statements for all accounts of the user. You still need to
* pass one of the accounts into $account, though.
* @return GetStatementOfAccount A new action instance.
*/
public static function create(SEPAAccount $account, ?\DateTime $from = null, ?\DateTime $to = null, bool $allAccounts = false, bool $includeUnbooked = false): GetStatementOfAccount
public static function create(SEPAAccount $account, ?\DateTimeInterface $from = null, ?\DateTimeInterface $to = null, bool $allAccounts = false, bool $includeUnbooked = false): GetStatementOfAccount
{
if ($from !== null && $to !== null && $from > $to) {
throw new \InvalidArgumentException('From-date must be before to-date');
Expand Down
25 changes: 11 additions & 14 deletions src/Action/GetStatementOfAccountXML.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/** @noinspection PhpUnused */

namespace Fhp\Action;
Expand All @@ -26,34 +28,29 @@
class GetStatementOfAccountXML extends PaginateableAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
private $account;
/** @var \DateTime */
private $from;
/** @var \DateTime */
private $to;
/** @var string */
private $camtURN;
/** @var bool */
private $allAccounts;
private SEPAAccount $account;
private ?\DateTimeInterface $from = null;
private ?\DateTimeInterface $to = null;
private ?string $camtURN = null;
private bool $allAccounts;

// Response
/** @var string[] */
protected $xml = [];
protected array $xml = [];

/**
* @param SEPAAccount $account The account to get the statement for. This can be constructed based on information
* that the user entered, or it can be {@link SEPAAccount} instance retrieved from {@link getAccounts()}.
* @param \DateTime|null $from If set, only transactions after this date (inclusive) are returned.
* @param \DateTime|null $to If set, only transactions before this date (inclusive) are returned.
* @param \DateTimeInterface|null $from If set, only transactions after this date (inclusive) are returned.
* @param \DateTimeInterface|null $to If set, only transactions before this date (inclusive) are returned.
* @param string|null $camtURN The URN/descriptor of the CAMT XML format you want the bank to return.
* Use null to just let the bank decide. Otherwise needs to be one of the reported URNs the bank supports.
* For example urn:iso:std:iso:20022:tech:xsd:camt.052.001.02
* @param bool $allAccounts If set to true, will return statements for all accounts of the user. You still need to
* pass one of the accounts into $account, though.
* @return GetStatementOfAccountXML A new action instance.
*/
public static function create(SEPAAccount $account, ?\DateTime $from = null, ?\DateTime $to = null, ?string $camtURN = null, bool $allAccounts = false): GetStatementOfAccountXML
public static function create(SEPAAccount $account, ?\DateTimeInterface $from = null, ?\DateTimeInterface $to = null, ?string $camtURN = null, bool $allAccounts = false): GetStatementOfAccountXML
{
if ($from !== null && $to !== null && $from > $to) {
throw new \InvalidArgumentException('From-date must be before to-date');
Expand Down
11 changes: 5 additions & 6 deletions src/Action/SendInternationalCreditTransfer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\BaseAction;
Expand All @@ -15,12 +17,9 @@
class SendInternationalCreditTransfer extends BaseAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
protected $account;
/** @var string */
protected $dtavzData;
/** @var string|null */
protected $dtavzVersion;
protected SEPAAccount $account;
protected string $dtavzData;
protected ?string $dtavzVersion = null;

/**
* @param SEPAAccount $account The account of the creditor (the sender of the money)
Expand Down
25 changes: 10 additions & 15 deletions src/Action/SendSEPADirectDebit.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\BaseAction;
Expand All @@ -25,20 +27,13 @@
class SendSEPADirectDebit extends BaseAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
protected $account;
/** @var string */
protected $painMessage;
/** @var string */
protected $painNamespace;
/** @var float */
protected $ctrlSum;
/** @var bool */
protected $singleDirectDebit = false;
/** @var bool */
protected $tryToUseControlSumForSingleTransactions = false;
/** @var string */
private $coreType;
protected SEPAAccount $account;
protected string $painMessage;
protected string $painNamespace;
protected ?float $ctrlSum = null;
protected bool $singleDirectDebit = false;
protected bool $tryToUseControlSumForSingleTransactions = false;
private ?string $coreType = null;
private bool $singleBookingRequested = false;

// There are no result fields. This action is simply marked as done to indicate that the transfer was executed.
Expand All @@ -56,7 +51,7 @@ public static function create(SEPAAccount $account, string $painMessage, bool $t
$ctrlSum = null;

if (preg_match('@<GrpHdr>.*?<CtrlSum>(?<ctrlsum>[0-9.]+)</CtrlSum>.*?</GrpHdr>@s', $painMessage, $matches) === 1) {
$ctrlSum = $matches['ctrlsum'];
$ctrlSum = (float) $matches['ctrlsum'];
}

if (preg_match('@<PmtTpInf>.*?<LclInstrm>.*?<Cd>(?<coretype>CORE|COR1|B2B)</Cd>.*?</LclInstrm>.*?</PmtTpInf>@s', $painMessage, $matches) === 1) {
Expand Down
11 changes: 5 additions & 6 deletions src/Action/SendSEPARealtimeTransfer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\BaseAction;
Expand All @@ -25,12 +27,9 @@
class SendSEPARealtimeTransfer extends BaseAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
private $account;
/** @var string */
private $painMessage;
/** @var string */
private $xmlSchema;
private SEPAAccount $account;
private string $painMessage;
private string $xmlSchema;
private bool $allowConversionToSEPATransfer = true;

// There are no result fields. This action is simply marked as done to indicate that the transfer was executed.
Expand Down
14 changes: 6 additions & 8 deletions src/Action/SendSEPATransfer.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Fhp\Action;

use Fhp\BaseAction;
Expand All @@ -20,14 +22,10 @@
class SendSEPATransfer extends BaseAction
{
// Request (if you add a field here, update __serialize() and __unserialize() as well).
/** @var SEPAAccount */
private $account;
/** @var string */
private $painMessage;
/** @var string */
private $xmlSchema;
/** @var bool */
private $singleBookingRequested = false;
private SEPAAccount $account;
private string $painMessage;
private string $xmlSchema;
private bool $singleBookingRequested = false;

// There are no result fields. This action is simply marked as done to indicate that the transfer was executed.

Expand Down