Skip to content

Commit

Permalink
XMLFile: fix assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
kockodev authored and h4kuna committed Mar 20, 2024
1 parent bfedc4c commit 83298b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Account/FioAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace h4kuna\Fio\Account;

class FioAccount
use Stringable;

class FioAccount implements Stringable
{
private Bank $account;

Expand Down Expand Up @@ -31,7 +33,7 @@ public function getToken(): string
}


public function __toString()
public function __toString(): string
{
return $this->getAccount();
}
Expand Down
5 changes: 3 additions & 2 deletions src/Pay/XMLFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace h4kuna\Fio\Pay;

use h4kuna\Fio\Exceptions\InvalidState;
use Stringable;
use XMLWriter;

class XMLFile
Expand Down Expand Up @@ -63,9 +64,9 @@ private function setBody(Payment\Property $data): self
$value = '';
}

assert(is_scalar($value));
assert(is_scalar($value) || $value instanceof Stringable);
$this->xml->startElement($node);
$this->xml->text(strval($value));
$this->xml->text((string) $value);
$this->xml->endElement();
}
$this->xml->endElement();
Expand Down

0 comments on commit 83298b7

Please sign in to comment.