Skip to content

Commit

Permalink
transaction id is string
Browse files Browse the repository at this point in the history
  • Loading branch information
mhujer committed Aug 4, 2017
1 parent 5696b6d commit 7d9c594
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/FioApi/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Transaction
{
/** @var float */
/** @var string */
protected $id;

/** @var \DateTimeImmutable */
Expand Down Expand Up @@ -57,7 +57,7 @@ class Transaction
protected $specification;

protected function __construct(
float $id,
string $id,
\DateTimeImmutable $date,
float $amount,
string $currency,
Expand Down Expand Up @@ -101,7 +101,7 @@ protected function __construct(
public static function create(\stdClass $data): Transaction
{
return new self(
$data->column22->value, //ID pohybu
(string) $data->column22->value, //ID pohybu
new \DateTimeImmutable($data->column0->value), //Datum
$data->column1->value, //Objem
$data->column14->value, //Měna
Expand All @@ -121,7 +121,7 @@ public static function create(\stdClass $data): Transaction
);
}

public function getId(): float
public function getId(): string
{
return $this->id;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/FioApi/TransactionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function testAccountValuesAreProperlySet()

$transaction = Transaction::create($transaction);

$this->assertSame((float) 1111111111, $transaction->getId());
$this->assertSame('1111111111', $transaction->getId());
$this->assertEquals(new \DateTimeImmutable('2015-03-30+0200'), $transaction->getDate());
$this->assertSame(127.0, $transaction->getAmount());
$this->assertSame('CZK', $transaction->getCurrency());
Expand Down

0 comments on commit 7d9c594

Please sign in to comment.