PluginProbe
Packeta / 1.3.0
Packeta v1.3.0
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
packeta / src / Packetery / Core / Api / Soap / Response / BaseResponse.php

BaseResponse.php in Packeta 1.3.0, at src/Packetery/Core/Api/Soap/Response/BaseResponse.php

79 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class BaseResponse.
4 *
5 * @package Packetery\Core\Api\Soap\Response
6 */
7
8 declare( strict_types=1 );
9
10 namespace Packetery\Core\Api\Soap\Response;
11
12 /**
13 * Class BaseResponse.
14 *
15 * @package Packetery\Core\Api\Soap\Response
16 */
17 class BaseResponse {
18
19 /**
20 * Fault identifier.
21 *
22 * @var ?string
23 */
24 protected $fault;
25
26 /**
27 * Fault string.
28 *
29 * @var ?string
30 */
31 private $faultString;
32
33 /**
34 * Checks if is faulty.
35 *
36 * @return bool
37 */
38 public function hasFault(): bool {
39 return (bool) $this->fault;
40 }
41
42 /**
43 * Checks if password is faulty.
44 *
45 * @return bool
46 */
47 public function hasWrongPassword(): bool {
48 return ( 'IncorrectApiPasswordFault' === $this->fault );
49 }
50
51 /**
52 * Sets fault identifier.
53 *
54 * @param string $fault Fault identifier.
55 */
56 public function setFault( string $fault ): void {
57 $this->fault = $fault;
58 }
59
60 /**
61 * Sets fault string.
62 *
63 * @param string $faultString Fault string.
64 */
65 public function setFaultString( string $faultString ): void {
66 $this->faultString = $faultString;
67 }
68
69 /**
70 * Gets fault string.
71 *
72 * @return string|null
73 */
74 public function getFaultString(): ?string {
75 return $this->faultString;
76 }
77
78 }
79