Completed
Pull Request — master (#18)
by ARCANEDEV
07:31
created

ApiKeyNotSetException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 13
nc 1
nop 7
crap 1
1
<?php namespace Arcanedev\Stripe\Exceptions;
2
3
/**
4
 * Class     ApiKeyNotSetException
5
 *
6
 * @package  Arcanedev\Stripe\Exceptions
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class ApiKeyNotSetException extends AuthenticationException
10
{
11
    /* ------------------------------------------------------------------------------------------------
12
     |  Constructor
13
     | ------------------------------------------------------------------------------------------------
14
     */
15
    /**
16
     * API Key Not Set Constructor.
17
     *
18
     * @param  string       $message
19
     * @param  int          $code
20
     * @param  string|null  $type
21
     * @param  string|null  $stripeCode
22
     * @param  string|null  $httpBody
23
     * @param  array        $jsonBody
24
     * @param  array        $params
25
     */
26 10
    public function __construct(
27
        $message,
28
        $code = 500,
29
        $type = 'api_error',
30
        $stripeCode = null,
31
        $httpBody = null,
32
        $jsonBody = [],
33
        $params = []
34
    ) {
35
        $message = 'No API key provided.  (HINT: set your API key using '
36
        . '"Stripe::setApiKey(<API-KEY>)".  You can generate API keys from '
37 8
        . 'the Stripe web interface.  See https://stripe.com/api for '
38 10
        . 'details, or email [email protected] if you have any questions.';
39
40 10
        parent::__construct($message, $code, $type);
41 10
    }
42
}
43