Skip to content

Commit cf2cd15

Browse files
committed
Fixed typos and comments. Renamed class to make it more understandable.
1 parent c758045 commit cf2cd15

File tree

3 files changed

+10
-47
lines changed

3 files changed

+10
-47
lines changed

Collector/DebugPlugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Psr\Http\Message\ResponseInterface;
99

1010
/**
11-
* A plugin used for log requests and responses passing through each plugin.
11+
* A plugin used for log requests and responses. This plugin is executed between each normal plugin.
1212
*
1313
* @author Tobias Nyholm <[email protected]>
1414
*/

Collector/DebugPluginCollector.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1212

1313
/**
14+
* A data collector for the debug plugin.
1415
* @author Tobias Nyholm <[email protected]>
1516
*/
1617
class DebugPluginCollector extends DataCollector
@@ -121,11 +122,13 @@ public function getTotalRequests()
121122
}
122123

123124
/**
124-
* @return ClientDataProvider[]
125+
* Return a RequestStackProvider for each client.
126+
*
127+
* @return RequestStackProvider[]
125128
*/
126129
public function getClients()
127130
{
128-
return ClientDataProvider::createFromCollectedData($this->data);
131+
return RequestStackProvider::createFromCollectedData($this->data);
129132
}
130133

131134
/**

Collector/ClientDataProvider.php renamed to Collector/RequestStackProvider.php

+4-44
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
namespace Http\HttplugBundle\Collector;
44

55
/**
6-
* An object to handle the collected data for a client. This is used to display data.
6+
* An object that managed collected data for each client. This is used to display data.
77
*
88
* The Request object at $requests[0][2] is the state of the object between the third
99
* and the fourth plugin. The response after that plugin is found in $responses[0][2].
1010
*
1111
* @author Tobias Nyholm <[email protected]>
1212
*/
13-
class ClientDataProvider
13+
class RequestStackProvider
1414
{
1515
/**
1616
* Array that tell if a request errored or not. true = success, false = failure.
@@ -54,7 +54,7 @@ public function __construct(array $failure, array $requests, array $responses)
5454
*
5555
* @param array $data
5656
*
57-
* @return ClientDataProvider[]
57+
* @return RequestStackProvider[]
5858
*/
5959
public static function createFromCollectedData(array $data)
6060
{
@@ -70,7 +70,7 @@ public static function createFromCollectedData(array $data)
7070
* @param array $messages is an array with keys 'failure', 'request' and 'response' which hold requests for each call to
7171
* sendRequest and for each depth.
7272
*
73-
* @return ClientDataProvider
73+
* @return RequestStackProvider
7474
*/
7575
private static function createOne($messages)
7676
{
@@ -99,46 +99,6 @@ private static function createOne($messages)
9999
return new self($orderedFaulure, $orderedRequests, $orderedResponses);
100100
}
101101

102-
/**
103-
* @return array
104-
*/
105-
public function getRequests()
106-
{
107-
return $this->requests;
108-
}
109-
110-
/**
111-
* @param array $requests
112-
*
113-
* @return ClientDataProvider
114-
*/
115-
public function setRequests($requests)
116-
{
117-
$this->requests = $requests;
118-
119-
return $this;
120-
}
121-
122-
/**
123-
* @return array
124-
*/
125-
public function getResponses()
126-
{
127-
return $this->responses;
128-
}
129-
130-
/**
131-
* @param array $responses
132-
*
133-
* @return ClientDataProvider
134-
*/
135-
public function setResponses($responses)
136-
{
137-
$this->responses = $responses;
138-
139-
return $this;
140-
}
141-
142102
/**
143103
* Get the index keys for the request and response stacks.
144104
*

0 commit comments

Comments
 (0)