1 | <?php |
||
7 | class SocketClient |
||
8 | { |
||
9 | const PAYLOAD_MAX_BYTES = 256; |
||
10 | |||
11 | /** |
||
12 | * @var \JWage\APNS\Certificate |
||
13 | */ |
||
14 | private $certificate; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $host; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | private $port; |
||
25 | |||
26 | /** |
||
27 | * @var Resource |
||
28 | */ |
||
29 | private $apnsResource; |
||
30 | |||
31 | /** |
||
32 | * @var integer |
||
33 | */ |
||
34 | private $error; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | private $errorString; |
||
40 | |||
41 | /** |
||
42 | * Construct. |
||
43 | * |
||
44 | * @param \JWage\APNS\Certificate $certificate |
||
45 | * @param string $host |
||
46 | * @param string $port |
||
47 | */ |
||
48 | public function __construct(Certificate $certificate, $host, $port) |
||
54 | |||
55 | public function __destruct() |
||
61 | |||
62 | /** |
||
63 | * Writes a binary message to apns. |
||
64 | * |
||
65 | * @param string $binaryMessage |
||
66 | * @return integer Returns the number of bytes written, or FALSE on error. |
||
67 | */ |
||
68 | public function write($binaryMessage) |
||
78 | |||
79 | /** |
||
80 | * @return Resource |
||
81 | */ |
||
82 | protected function getApnsResource() |
||
90 | |||
91 | /** |
||
92 | * @return Resource |
||
93 | */ |
||
94 | protected function createStreamContext() |
||
101 | |||
102 | /** |
||
103 | * @return Resource |
||
104 | */ |
||
105 | protected function createStreamClient() |
||
126 | |||
127 | /** |
||
128 | * @return string $socketAddress |
||
129 | */ |
||
130 | protected function getSocketAddress() |
||
134 | } |
||
135 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.