Passed
Push — master ( 61b2f8...584670 )
by Chubarov
05:03
created

CheckTicketXmlResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

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