Completed
Push — master ( 77c628...ce2be0 )
by Olivier
03:34
created

Request::getIdempotencyKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This software may be modified and distributed under the terms
7
 * of the MIT license. See the LICENSE file for details.
8
 */
9
10
namespace Shapin\Stripe\Model\Event;
11
12
use Shapin\Stripe\Model\CreatableFromArray;
13
14
final class Request implements CreatableFromArray
15
{
16
    /**
17
     * @var ?string
18
     */
19
    private $id;
20
21
    /**
22
     * @var ?string
23
     */
24
    private $idempotencyKey;
25
26
    private function __construct()
27
    {
28
    }
29
30
    public static function createFromArray(array $data): self
31
    {
32
        $model = new self();
33
        $model->id = $data['id'];
34
        $model->idempotencyKey = $data['idempotency_key'];
35
36
        return $model;
37
    }
38
39
    public function getId(): ?string
40
    {
41
        return $this->id;
42
    }
43
44
    public function getIdempotencyKey(): ?string
45
    {
46
        return $this->idempotencyKey;
47
    }
48
}
49