Completed
Push — master ( 7b285b...480624 )
by Rigel Kent
04:14
created

Source   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 25
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A setData() 0 13 1
1
<?php
2
3
namespace Luigel\Paymongo\Models;
4
5
class Source
6
{
7
    public $id;
8
    public $type;
9
    public $currency;
10
    public $status;
11
    public $amount;
12
    public $redirect;
13
    public $source_type;
14
    public $created_at;
15
16
    public function setData($data)
17
    {
18
        $this->id = $data['id'];
19
        $this->type = $data['type'];
20
        $this->currency = $data['attributes']['currency'];
21
        $this->status = $data['attributes']['status'];
22
        $this->amount = number_format($data['attributes']['amount'] / 100, 2);
23
        $this->redirect = $data['attributes']['redirect'];
24
        $this->source_type = $data['attributes']['type'];
25
        $this->created_at = $data['attributes']['created_at'];
26
27
        return $this;
28
    }
29
}
30