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

EphemeralKey   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 7 2
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