Skip to content

Commit

Permalink
Make FinTsNew::getSelectedTanMode() public
Browse files Browse the repository at this point in the history
It can be useful for application code, because the TanMode object contains information about the TAN format (allowed characters, maximum length) that the TanRequest does not contain.
  • Loading branch information
Philipp91 committed Jan 4, 2020
1 parent bb10a1e commit 4e9bfcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Fhp/FinTsNew.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,11 @@ private function ensureSynchronized()
/**
* If the selected TAN mode was provided as an int, resolves it to a full {@link TanMode} instance, which may
* involve a request to the server to retrieve the BPD. Then returns it.
* @return VerfahrensparameterZweiSchrittVerfahrenV6|null The current TAN mode, null if none was selected, never an int.
* @return TanMode|null The current TAN mode, null if none was selected, never an int.
* @throws CurlException When the connection fails in a layer below the FinTS protocol.
* @throws ServerException When the server resopnds with an error during the BPD fetch.
*/
private function getSelectedTanMode(): ?VerfahrensparameterZweischrittVerfahrenV6
public function getSelectedTanMode(): ?TanMode
{
if (is_int($this->selectedTanMode)) {
$this->ensureBpdAvailable();
Expand Down Expand Up @@ -560,12 +560,12 @@ private function getSelectedTanMode(): ?VerfahrensparameterZweischrittVerfahrenV

/**
* Like {@link #getSelectedTanMode()}, but throws an exception if none was selected.
* @return VerfahrensparameterZweiSchrittVerfahrenV6 The current TAN mode.
* @return TanMode The current TAN mode.
* @throws \RuntimeException If no TAN mode has been selected.
* @throws CurlException When the connection fails in a layer below the FinTS protocol.
* @throws ServerException When the server resopnds with an error during the BPD fetch.
*/
private function requireTanMode(): VerfahrensparameterZweiSchrittVerfahrenV6
private function requireTanMode(): TanMode
{
$tanMode = $this->getSelectedTanMode();
if ($tanMode === null) {
Expand Down

0 comments on commit 4e9bfcf

Please sign in to comment.