PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | vendor_prefixed/guzzlehttp/guzzle/src/TransferStats.php +24 -20 18.4 → trunk View file →
@@ -10,12 +10,27 @@
10 10 * or after a network error.
11 11 */
12 12 final class TransferStats
13 13 {
14 + /**
15 + * @var RequestInterface
16 + */
14 17 private $request;
18 + /**
19 + * @var ResponseInterface|null
20 + */
15 21 private $response;
22 + /**
23 + * @var float|null
24 + */
16 25 private $transferTime;
26 + /**
27 + * @var array
28 + */
17 29 private $handlerStats;
30 + /**
31 + * @var mixed|null
32 + */
18 33 private $handlerErrorData;
19 34 /**
20 35 * @param RequestInterface $request Request that was sent.
21 36 * @param ResponseInterface|null $response Response received (if any)
@@ -22,9 +37,9 @@
22 37 * @param float|null $transferTime Total handler transfer time.
23 38 * @param mixed $handlerErrorData Handler error data.
24 39 * @param array $handlerStats Handler specific stats.
25 40 */
26 - public function __construct(\YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, \YoastSEO_Vendor\Psr\Http\Message\ResponseInterface $response = null, $transferTime = null, $handlerErrorData = null, $handlerStats = [])
41 + public function __construct(\YoastSEO_Vendor\Psr\Http\Message\RequestInterface $request, ?\YoastSEO_Vendor\Psr\Http\Message\ResponseInterface $response = null, ?float $transferTime = null, $handlerErrorData = null, array $handlerStats = [])
27 42 {
28 43 $this->request = $request;
29 44 $this->response = $response;
30 45 $this->transferTime = $transferTime;
@@ -30,30 +45,23 @@
30 45 $this->transferTime = $transferTime;
31 46 $this->handlerErrorData = $handlerErrorData;
32 47 $this->handlerStats = $handlerStats;
33 48 }
34 - /**
35 - * @return RequestInterface
36 - */
37 - public function getRequest()
49 + public function getRequest() : \YoastSEO_Vendor\Psr\Http\Message\RequestInterface
38 50 {
39 51 return $this->request;
40 52 }
41 53 /**
42 54 * Returns the response that was received (if any).
43 - *
44 - * @return ResponseInterface|null
45 55 */
46 - public function getResponse()
56 + public function getResponse() : ?\YoastSEO_Vendor\Psr\Http\Message\ResponseInterface
47 57 {
48 58 return $this->response;
49 59 }
50 60 /**
51 61 * Returns true if a response was received.
52 - *
53 - * @return bool
54 62 */
55 - public function hasResponse()
63 + public function hasResponse() : bool
56 64 {
57 65 return $this->response !== null;
58 66 }
59 67 /**
@@ -70,12 +78,10 @@
70 78 return $this->handlerErrorData;
71 79 }
72 80 /**
73 81 * Get the effective URI the request was sent to.
74 - *
75 - * @return UriInterface
76 82 */
77 - public function getEffectiveUri()
83 + public function getEffectiveUri() : \YoastSEO_Vendor\Psr\Http\Message\UriInterface
78 84 {
79 85 return $this->request->getUri();
80 86 }
81 87 /**
@@ -82,18 +88,16 @@
82 88 * Get the estimated time the request was being transferred by the handler.
83 89 *
84 90 * @return float|null Time in seconds.
85 91 */
86 - public function getTransferTime()
92 + public function getTransferTime() : ?float
87 93 {
88 94 return $this->transferTime;
89 95 }
90 96 /**
91 97 * Gets an array of all of the handler specific transfer data.
92 - *
93 - * @return array
94 98 */
95 - public function getHandlerStats()
99 + public function getHandlerStats() : array
96 100 {
97 101 return $this->handlerStats;
98 102 }
99 103 /**
@@ -102,9 +106,9 @@
102 106 * @param string $stat Handler specific transfer stat to retrieve.
103 107 *
104 108 * @return mixed|null
105 109 */
106 - public function getHandlerStat($stat)
110 + public function getHandlerStat(string $stat)
107 111 {
108 - return isset($this->handlerStats[$stat]) ? $this->handlerStats[$stat] : null;
112 + return $this->handlerStats[$stat] ?? null;
109 113 }
110 114 }