@@ -48,7 +48,7 @@ public function __construct(string $message, int $code, ResponseInterface $respo
48
48
}
49
49
}
50
50
51
- public static function badRequest (ResponseInterface $ response )
51
+ public static function badRequest (ResponseInterface $ response ): self
52
52
{
53
53
$ body = $ response ->getBody ()->__toString ();
54
54
if (0 !== strpos ($ response ->getHeaderLine ('Content-Type ' ), 'application/json ' )) {
@@ -63,37 +63,37 @@ public static function badRequest(ResponseInterface $response)
63
63
return new self ($ message , 400 , $ response );
64
64
}
65
65
66
- public static function unauthorized (ResponseInterface $ response )
66
+ public static function unauthorized (ResponseInterface $ response ): self
67
67
{
68
68
return new self ('Your credentials are incorrect. ' , 401 , $ response );
69
69
}
70
70
71
- public static function requestFailed (ResponseInterface $ response )
71
+ public static function requestFailed (ResponseInterface $ response ): self
72
72
{
73
73
return new self ('Parameters were valid but request failed. Try again. ' , 402 , $ response );
74
74
}
75
75
76
- public static function notFound (ResponseInterface $ response )
76
+ public static function notFound (ResponseInterface $ response ): self
77
77
{
78
78
return new self ('The endpoint you have tried to access does not exist. Check if the domain matches the domain you have configure on Mailgun. ' , 404 , $ response );
79
79
}
80
80
81
- public static function conflict (ResponseInterface $ response )
81
+ public static function conflict (ResponseInterface $ response ): self
82
82
{
83
83
return new self ('Request conflicts with current state of the target resource. ' , 409 , $ response );
84
84
}
85
85
86
- public static function payloadTooLarge (ResponseInterface $ response )
86
+ public static function payloadTooLarge (ResponseInterface $ response ): self
87
87
{
88
88
return new self ('Payload too large, your total attachment size is too big. ' , 413 , $ response );
89
89
}
90
90
91
- public static function tooManyRequests (ResponseInterface $ response )
91
+ public static function tooManyRequests (ResponseInterface $ response ): self
92
92
{
93
93
return new self ('Too many requests. ' , 429 , $ response );
94
94
}
95
95
96
- public static function forbidden (ResponseInterface $ response )
96
+ public static function forbidden (ResponseInterface $ response ): self
97
97
{
98
98
$ body = $ response ->getBody ()->__toString ();
99
99
if (0 !== strpos ($ response ->getHeaderLine ('Content-Type ' ), 'application/json ' )) {
0 commit comments