Test Failed
Push — master ( 3dd85e...34f16b )
by Devin
04:34 queued 10s
created

EphemeralKey::create()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 2
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Stripe;
4
5
/**
6
 * Class EphemeralKey
7
 *
8
 * @property string $id
9
 * @property string $object
10
 * @property int $created
11
 * @property int $expires
12
 * @property bool $livemode
13
 * @property string $secret
14
 * @property array $associated_objects
15
 *
16
 * @package Stripe
17
 */
18
class EphemeralKey extends ApiResource
19
{
20
21
    const OBJECT_NAME = "ephemeral_key";
22
23
    use ApiOperations\Create {
24
        create as protected _create;
25
    }
26
    use ApiOperations\Delete;
27
28
    /**
29
     * @param array|null $params
30
     * @param array|string|null $opts
31
     *
32
     * @return EphemeralKey The created key.
33
     */
34
    public static function create($params = null, $opts = null)
35
    {
36
        if (!$opts['stripe_version']) {
37
            throw new \InvalidArgumentException('stripe_version must be specified to create an ephemeral key');
38
        }
39
        return self::_create($params, $opts);
40
    }
41
}
42