1 | <?php |
||
8 | class PayplugIPNService |
||
9 | { |
||
10 | /** |
||
11 | * Payplug public key from configuration |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | private $payplugPublicKey; |
||
16 | |||
17 | /** |
||
18 | * IPN class from configuration used to create ipn instance |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | private $ipnClass; |
||
23 | |||
24 | /** |
||
25 | * @param string $payplugPublicKey |
||
26 | */ |
||
27 | public function __construct($payplugPublicKey, $ipnClass) |
||
32 | |||
33 | /** |
||
34 | * Verify ipn request validity |
||
35 | * |
||
36 | * @param Request $request |
||
37 | * |
||
38 | * @return boolean |
||
39 | */ |
||
40 | public function verifyIPNRequest(Request $request) |
||
47 | |||
48 | /** |
||
49 | * Verify ipn content |
||
50 | * |
||
51 | * @param string $body |
||
52 | * @param string $signature |
||
53 | * |
||
54 | * @return boolean |
||
55 | */ |
||
56 | public function verifyIPN($body, $signature) |
||
61 | |||
62 | /** |
||
63 | * Create IPN instance from body json data |
||
64 | * |
||
65 | * @param string $body |
||
66 | * |
||
67 | * @return IPN |
||
68 | */ |
||
69 | public function createIPNFromBody($body) |
||
75 | |||
76 | /** |
||
77 | * Build IPN instance from array |
||
78 | * |
||
79 | * @param array $data |
||
80 | * |
||
81 | * @return IPN |
||
82 | */ |
||
83 | public function createIPNFromData(array $data) |
||
101 | } |
||
102 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.