minulislam /
multicoin-api
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Multicoin\Api\Exceptions; |
||||
| 4 | |||||
| 5 | use Exception; |
||||
| 6 | use Illuminate\Http\Request; |
||||
| 7 | |||||
| 8 | class WebhookFailed extends Exception |
||||
| 9 | { |
||||
| 10 | public static function invalidSignature($signature) |
||||
| 11 | { |
||||
| 12 | return new static("The signature `{$signature}` found in the header named `X-Multicoin-Signature` is invalid. |
||||
|
0 ignored issues
–
show
|
|||||
| 13 | Make sure that the `multicoin.api_key` config key is set to the value you found on the multicoin account."); |
||||
| 14 | } |
||||
| 15 | |||||
| 16 | public static function missingSignature() |
||||
| 17 | { |
||||
| 18 | return new static('The request did not contain a header named `X-Multicoin-Signature`.'); |
||||
| 19 | } |
||||
| 20 | |||||
| 21 | public static function missingType(Request $request) |
||||
|
0 ignored issues
–
show
The parameter
$request is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 22 | { |
||||
| 23 | return new static('The webhook call did not contain a type. Valid calls should always contain a type.'); |
||||
| 24 | } |
||||
| 25 | |||||
| 26 | public function render($request) |
||||
|
0 ignored issues
–
show
The parameter
$request is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 27 | { |
||||
| 28 | return response(['error' => $this->getMessage()], 400); |
||||
| 29 | } |
||||
| 30 | |||||
| 31 | public static function signingSecretNotSet() |
||||
| 32 | { |
||||
| 33 | return new static('The webhook signing secret is not set. |
||||
| 34 | Make sure that the `multicoin.api_key` config key is set.'); |
||||
| 35 | } |
||||
| 36 | } |
||||
| 37 |
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.