Event::all()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
crap 1
1
<?php namespace Arcanedev\Stripe\Resources;
2
3
use Arcanedev\Stripe\Contracts\Resources\Event as EventContract;
4
use Arcanedev\Stripe\StripeResource;
5
6
/**
7
 * Class     Event
8
 *
9
 * @package  Arcanedev\Stripe\Resources
10
 * @author   ARCANEDEV <[email protected]>
11
 * @link     https://stripe.com/docs/api/php#event_object
12
 * @link     https://stripe.com/docs/api/php#event_types
13
 *
14
 * @property  string                          id
15
 * @property  string                          object            // 'event'
16
 * @property  string                          api_version
17
 * @property  int                             created           // timestamp
18
 * @property  \Arcanedev\Stripe\StripeObject  data
19
 * @property  bool                            livemode
20
 * @property  int                             pending_webhooks
21
 * @property  string                          request
22
 * @property  string                          type
23
 */
24
class Event extends StripeResource implements EventContract
25
{
26
    /* ------------------------------------------------------------------------------------------------
27
     |  Main Functions
28
     | ------------------------------------------------------------------------------------------------
29
     */
30
    /**
31
     * Retrieve an event.
32
     * @link   https://stripe.com/docs/api/php#retrieve_event
33
     *
34
     * @param  string             $id
35
     * @param  array|string|null  $options
36
     *
37
     * @return self
38
     */
39 2
    public static function retrieve($id, $options = null)
40
    {
41 2
        return self::scopedRetrieve($id, $options);
42
    }
43
44
    /**
45
     * List all events.
46
     * @link   https://stripe.com/docs/api/php#list_events
47
     *
48
     * @param  array|null         $params
49
     * @param  array|string|null  $options
50
     *
51
     * @return \Arcanedev\Stripe\Collection|array
52
     */
53 4
    public static function all($params = [], $options = null)
54
    {
55 4
        return self::scopedAll($params, $options);
56
    }
57
}
58