Skip to content

Commit 83298b7

Browse files
kockodevh4kuna
authored andcommitted
XMLFile: fix assertion
1 parent bfedc4c commit 83298b7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Account/FioAccount.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace h4kuna\Fio\Account;
44

5-
class FioAccount
5+
use Stringable;
6+
7+
class FioAccount implements Stringable
68
{
79
private Bank $account;
810

@@ -31,7 +33,7 @@ public function getToken(): string
3133
}
3234

3335

34-
public function __toString()
36+
public function __toString(): string
3537
{
3638
return $this->getAccount();
3739
}

src/Pay/XMLFile.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace h4kuna\Fio\Pay;
44

55
use h4kuna\Fio\Exceptions\InvalidState;
6+
use Stringable;
67
use XMLWriter;
78

89
class XMLFile
@@ -63,9 +64,9 @@ private function setBody(Payment\Property $data): self
6364
$value = '';
6465
}
6566

66-
assert(is_scalar($value));
67+
assert(is_scalar($value) || $value instanceof Stringable);
6768
$this->xml->startElement($node);
68-
$this->xml->text(strval($value));
69+
$this->xml->text((string) $value);
6970
$this->xml->endElement();
7071
}
7172
$this->xml->endElement();

0 commit comments

Comments
 (0)