44
55namespace Prometee \PayumStripe \Request \Api ;
66
7+ use LogicException ;
78use Payum \Core \Request \Generic ;
89use Prometee \PayumStripe \Wrapper \EventWrapperInterface ;
910
1011class ConstructEvent extends Generic
1112{
12- /** @var null| string */
13+ /** @var string */
1314 private $ webhookSecretKey ;
1415 /** @var string */
1516 private $ sigHeader ;
1617
1718 /**
1819 * @param string $payload
1920 * @param string $sigHeader
20- * @param string|null $webhookSecretKey
21+ * @param string $webhookSecretKey
2122 */
2223 public function __construct (
2324 string $ payload ,
2425 string $ sigHeader ,
25- string $ webhookSecretKey = null
26+ string $ webhookSecretKey
2627 ) {
2728 parent ::__construct ($ payload );
2829 $ this ->sigHeader = $ sigHeader ;
2930 $ this ->webhookSecretKey = $ webhookSecretKey ;
3031 }
3132
3233 /**
33- * @return string|null
34+ * @return string
3435 */
35- public function getPayload (): ? string
36+ public function getPayload (): string
3637 {
3738 if (is_string ($ this ->getModel ())) {
3839 return (string ) $ this ->getModel ();
3940 }
4041
41- return null ;
42+ throw new LogicException ( ' The payload is not a string ! ' ) ;
4243 }
4344
4445 public function setPayload (string $ payload ): void
@@ -47,17 +48,17 @@ public function setPayload(string $payload): void
4748 }
4849
4950 /**
50- * @param string|null $webhookSecretKey
51+ * @param string $webhookSecretKey
5152 */
52- public function setWebhookSecretKey (? string $ webhookSecretKey ): void
53+ public function setWebhookSecretKey (string $ webhookSecretKey ): void
5354 {
5455 $ this ->webhookSecretKey = $ webhookSecretKey ;
5556 }
5657
5758 /**
58- * @return string|null
59+ * @return string
5960 */
60- public function getWebhookSecretKey (): ? string
61+ public function getWebhookSecretKey (): string
6162 {
6263 return $ this ->webhookSecretKey ;
6364 }
0 commit comments