Issues (21)

src/GetMessage/Response/GetTicketXmlResponse.php (2 issues)

1
<?php
2
declare(strict_types=1);
3
4
namespace Fns\GetMessage\Response;
5
6
use Fns\Contracts\ResponseReceipt;
7
use Fns\Contracts\ResponseSendMessage;
8
use Fns\Receipt;
9
use SimpleXMLElement;
10
11
class GetTicketXmlResponse extends SimpleXMLElement implements ResponseSendMessage, ResponseReceipt
12
{
13
    public function isError(): bool
14
    {
15
        return $this->getCode() !== 200;
16
    }
17
18
    public function getCode(): int
19
    {
20
        return (int)$this->Result->Code;
0 ignored issues
show
Bug Best Practice introduced by
The property Result does not exist on Fns\GetMessage\Response\GetTicketXmlResponse. Since you implemented __get, consider adding a @property annotation.
Loading history...
21
    }
22
23
    public function getBody(): string
24
    {
25
        return (string)$this->Result->Ticket;
0 ignored issues
show
Bug Best Practice introduced by
The property Result does not exist on Fns\GetMessage\Response\GetTicketXmlResponse. Since you implemented __get, consider adding a @property annotation.
Loading history...
26
    }
27
28
    public function getReceipt():Receipt
29
    {
30
        return new Receipt($this->getBody());
31
    }
32
}
33