Skip to content

Commit b70d6e9

Browse files
committed
Add ArrayShape on getInfo methods
1 parent 6866bbb commit b70d6e9

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

src/Response.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Framework\HTTP\ResponseHeader;
1717
use Framework\HTTP\ResponseInterface;
1818
use InvalidArgumentException;
19+
use JetBrains\PhpStorm\ArrayShape;
1920
use JetBrains\PhpStorm\Pure;
2021
use Override;
2122

@@ -80,6 +81,46 @@ public function getRequest() : Request
8081
/**
8182
* @return array<mixed>
8283
*/
84+
#[ArrayShape([
85+
'appconnect_time_us' => 'int',
86+
'certinfo' => 'array',
87+
'connect_time' => 'float',
88+
'connect_time_us' => 'int',
89+
'content_type' => 'string',
90+
'download_content_length' => 'float',
91+
'effective_method' => 'string',
92+
'filetime' => 'int',
93+
'header_size' => 'int',
94+
'http_code' => 'int',
95+
'http_version' => 'int',
96+
'local_ip' => 'string',
97+
'local_port' => 'int',
98+
'namelookup_time' => 'float',
99+
'namelookup_time_us' => 'int',
100+
'pretransfer_time' => 'float',
101+
'pretransfer_time_us' => 'int',
102+
'primary_ip' => 'string',
103+
'primary_port' => 'int',
104+
'protocol' => 'int',
105+
'redirect_count' => 'int',
106+
'redirect_time' => 'float',
107+
'redirect_time_us' => 'int',
108+
'redirect_url' => 'string',
109+
'request_size' => 'int',
110+
'scheme' => 'string',
111+
'size_download' => 'float',
112+
'size_upload' => 'float',
113+
'speed_download' => 'float',
114+
'speed_upload' => 'float',
115+
'ssl_verify_result' => 'int',
116+
'ssl_verifyresult' => 'int',
117+
'starttransfer_time' => 'float',
118+
'starttransfer_time_us' => 'int',
119+
'total_time' => 'float',
120+
'total_time_us' => 'int',
121+
'upload_content_length' => 'float',
122+
'url' => 'string',
123+
])]
83124
public function getInfo() : array
84125
{
85126
return $this->info;

src/ResponseError.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
namespace Framework\HTTP\Client;
1111

12+
use JetBrains\PhpStorm\ArrayShape;
13+
1214
/**
1315
* Class ResponseError.
1416
*
@@ -60,6 +62,46 @@ public function getErrorNumber() : int
6062
/**
6163
* @return array<mixed>
6264
*/
65+
#[ArrayShape([
66+
'appconnect_time_us' => 'int',
67+
'certinfo' => 'array',
68+
'connect_time' => 'float',
69+
'connect_time_us' => 'int',
70+
'content_type' => 'string',
71+
'download_content_length' => 'float',
72+
'effective_method' => 'string',
73+
'filetime' => 'int',
74+
'header_size' => 'int',
75+
'http_code' => 'int',
76+
'http_version' => 'int',
77+
'local_ip' => 'string',
78+
'local_port' => 'int',
79+
'namelookup_time' => 'float',
80+
'namelookup_time_us' => 'int',
81+
'pretransfer_time' => 'float',
82+
'pretransfer_time_us' => 'int',
83+
'primary_ip' => 'string',
84+
'primary_port' => 'int',
85+
'protocol' => 'int',
86+
'redirect_count' => 'int',
87+
'redirect_time' => 'float',
88+
'redirect_time_us' => 'int',
89+
'redirect_url' => 'string',
90+
'request_size' => 'int',
91+
'scheme' => 'string',
92+
'size_download' => 'float',
93+
'size_upload' => 'float',
94+
'speed_download' => 'float',
95+
'speed_upload' => 'float',
96+
'ssl_verify_result' => 'int',
97+
'ssl_verifyresult' => 'int',
98+
'starttransfer_time' => 'float',
99+
'starttransfer_time_us' => 'int',
100+
'total_time' => 'float',
101+
'total_time_us' => 'int',
102+
'upload_content_length' => 'float',
103+
'url' => 'string',
104+
])]
63105
public function getInfo() : array
64106
{
65107
return $this->info;

0 commit comments

Comments
 (0)