Passed
Branch master (627165)
by Songda
02:12
created

Request::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yansongda\Pay;
6
7
use JsonSerializable as JsonSerializableInterface;
8
use Serializable as SerializableInterface;
9
use Yansongda\Supports\Traits\Accessable;
10
use Yansongda\Supports\Traits\Arrayable;
11
use Yansongda\Supports\Traits\Serializable;
12
13
class Request extends \GuzzleHttp\Psr7\Request implements JsonSerializableInterface, SerializableInterface
14
{
15
    use Accessable;
16
    use Arrayable;
17
    use Serializable;
18
19
    public function toArray(): array
20
    {
21
        return [
22
            'url' => $this->getUri()->__toString(),
23
            'method' => $this->getMethod(),
24
            'headers' => $this->getHeaders(),
25
            'body' => $this->getBody()->getContents(),
26
        ];
27
    }
28
}
29