33namespace Imdhemy \AppStore \Receipts ;
44
55use GuzzleHttp \Client ;
6+ use GuzzleHttp \ClientInterface ;
67use GuzzleHttp \Exception \GuzzleException ;
78use Imdhemy \AppStore \ClientFactory ;
89use Imdhemy \AppStore \Exceptions \InvalidReceiptException ;
@@ -21,7 +22,7 @@ class Verifier
2122 public const VERIFY_RECEIPT_PATH = '/verifyReceipt ' ;
2223
2324 /**
24- * @var Client
25+ * @var ClientInterface
2526 */
2627 protected $ client ;
2728
@@ -38,25 +39,25 @@ class Verifier
3839 /**
3940 * Receipt constructor.
4041 *
41- * @param Client $client
42+ * @param ClientInterface $client
4243 * @param string $receiptData
4344 * @param string $password
4445 */
45- public function __construct (Client $ client , string $ receiptData , string $ password )
46+ public function __construct (ClientInterface $ client , string $ receiptData , string $ password )
4647 {
4748 $ this ->client = $ client ;
4849 $ this ->receiptData = $ receiptData ;
4950 $ this ->password = $ password ;
5051 }
5152
5253 /**
53- * @param Client |null $sandboxClient
54+ * @param ClientInterface |null $sandboxClient
5455 *
5556 * @return ReceiptResponse
5657 * @throws GuzzleException|InvalidReceiptException
5758 * @deprecated Use verify() instead - this method will be removed in the next major release
5859 */
59- public function verifyRenewable (?Client $ sandboxClient = null ): ReceiptResponse
60+ public function verifyRenewable (?ClientInterface $ sandboxClient = null ): ReceiptResponse
6061 {
6162 return $ this ->verify (true , $ sandboxClient );
6263 }
@@ -68,8 +69,10 @@ public function verifyRenewable(?Client $sandboxClient = null): ReceiptResponse
6869 * @return ReceiptResponse
6970 * @throws GuzzleException|InvalidReceiptException
7071 */
71- public function verify (bool $ excludeOldTransactions = false , ?Client $ sandboxClient = null ): ReceiptResponse
72- {
72+ public function verify (
73+ bool $ excludeOldTransactions = false ,
74+ ?ClientInterface $ sandboxClient = null
75+ ): ReceiptResponse {
7376 $ responseBody = $ this ->sendVerifyRequest ($ excludeOldTransactions );
7477 $ status = $ responseBody ['status ' ];
7578
@@ -87,12 +90,12 @@ public function verify(bool $excludeOldTransactions = false, ?Client $sandboxCli
8790
8891 /**
8992 * @param bool $excludeOldTransactions
90- * @param Client |null $client
93+ * @param ClientInterface |null $client
9194 *
9295 * @return array
9396 * @throws GuzzleException
9497 */
95- private function sendVerifyRequest (bool $ excludeOldTransactions = false , ?Client $ client = null ): array
98+ private function sendVerifyRequest (bool $ excludeOldTransactions = false , ?ClientInterface $ client = null ): array
9699 {
97100 $ client = $ client ?? $ this ->client ;
98101 $ options = $ this ->buildRequestOptions ($ excludeOldTransactions );
0 commit comments