1 | <?php |
||
9 | class ApnConnection |
||
10 | { |
||
11 | /** |
||
12 | * The sandbox environment identifier. |
||
13 | * |
||
14 | * @var int |
||
15 | */ |
||
16 | const SANDBOX = 0; |
||
17 | |||
18 | /** |
||
19 | * The production environment identifier. |
||
20 | * |
||
21 | * @var int |
||
22 | */ |
||
23 | const PRODUCTION = 1; |
||
24 | |||
25 | /** |
||
26 | * The APNS client. |
||
27 | * |
||
28 | * @var \ZendService\Apple\Apns\Client\Message |
||
29 | */ |
||
30 | protected $client; |
||
31 | |||
32 | /** |
||
33 | * Create a new connection instance. |
||
34 | * |
||
35 | * @param \ZendService\Apple\Apns\Client\Message $client |
||
36 | * @return void |
||
|
|||
37 | */ |
||
38 | public function __construct(Client $client) |
||
42 | |||
43 | /** |
||
44 | * Open a new connection. |
||
45 | * |
||
46 | * @param string $environment |
||
47 | * @param string $certificate |
||
48 | * @param string $passPhrase |
||
49 | * @return void |
||
50 | * @throws \NotificationChannels\Apn\Exceptions\ConnectionFailed |
||
51 | */ |
||
52 | public function open($environment, $certificate, $passPhrase = null) |
||
60 | |||
61 | /** |
||
62 | * Send the provided packet over the existing connection. |
||
63 | * |
||
64 | * @param \ZendService\Apple\Apns\Message $message |
||
65 | * @return \ZendService\Apple\Apns\Response\Message |
||
66 | */ |
||
67 | public function send(Message $packet) |
||
71 | |||
72 | /** |
||
73 | * Close the existing connection. |
||
74 | * |
||
75 | * @return void |
||
76 | */ |
||
77 | public function close() |
||
81 | } |
||
82 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.