1 | <?php |
||
17 | abstract class AbstractWebSMSConnection implements ConnectionInterface, WebSmsApiParams |
||
18 | { |
||
19 | const TEST_DISABLED = 0; |
||
20 | const TEST_ENABLED = 1; |
||
21 | const TEST_SPECIAL = -1; |
||
22 | |||
23 | /** @var string */ |
||
24 | protected $username; |
||
25 | /** @var string */ |
||
26 | protected $password; |
||
27 | /** @var int */ |
||
28 | protected $test = self::TEST_DISABLED; |
||
29 | |||
30 | /** @var float */ |
||
31 | protected $balance; |
||
32 | |||
33 | /** @var DriverInterface */ |
||
34 | protected $driver; |
||
35 | /** @var FormDriver */ |
||
36 | protected $balanceDriver; |
||
37 | /** @var array */ |
||
38 | private $lastStatus; |
||
39 | |||
40 | /** |
||
41 | * @return float |
||
42 | */ |
||
43 | public function getBalance() |
||
47 | |||
48 | /** |
||
49 | * @param DriverInterface $driver |
||
50 | * @param $username |
||
51 | * @param $password |
||
52 | * @param int $test |
||
53 | */ |
||
54 | public function __construct(DriverInterface $driver, $username, $password, $test = self::TEST_DISABLED) |
||
62 | |||
63 | /** |
||
64 | * @param MessageInterface $message |
||
65 | * |
||
66 | * @return bool |
||
67 | * @throws DeliveryException |
||
68 | */ |
||
69 | protected function doSendRequest(MessageInterface $message) |
||
93 | |||
94 | /** |
||
95 | * @return array |
||
96 | */ |
||
97 | public function getLastStatus() |
||
101 | |||
102 | /** |
||
103 | * @return bool Verifies connection properties |
||
104 | * @throws CommunicationException |
||
105 | */ |
||
106 | public function verify() |
||
119 | } |
||
120 |