| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public static function createFromResponse(ResponseInterface $response): PayoutInfo |
||
| 16 | { |
||
| 17 | $data = json_decode($response->getBody()->getContents(), true)['data']; |
||
| 18 | $currency = new Currency($data['currencyId']); |
||
| 19 | |||
| 20 | return new PayoutInfo( |
||
| 21 | new Money($data['totalBalance'], $currency), |
||
| 22 | new Money($data['nextPayoutAmount'], $currency), |
||
| 23 | new Money($data['discountRemaining'], $currency), |
||
| 24 | Periodicity::get($data['periodicity']) |
||
| 25 | ); |
||
| 26 | } |
||
| 27 | } |
||
| 28 |