You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Client.php
+25-5Lines changed: 25 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -183,20 +183,28 @@ public function getCookieJar()
183
183
/**
184
184
* Returns the current Crawler instance.
185
185
*
186
-
* @return Crawler|null A Crawler instance
186
+
* @return Crawler A Crawler instance
187
187
*/
188
188
publicfunctiongetCrawler()
189
189
{
190
+
if (null === $this->crawler) {
191
+
@trigger_error(sprintf('The %s() method calling before request() method is deprecated since 4.1 and will throw an exception in 5.0.', __METHOD__), E_USER_DEPRECATED);
192
+
}
193
+
190
194
return$this->crawler;
191
195
}
192
196
193
197
/**
194
198
* Returns the current BrowserKit Response instance.
195
199
*
196
-
* @return Response|null A BrowserKit Response instance
200
+
* @return Response A BrowserKit Response instance
197
201
*/
198
202
publicfunctiongetInternalResponse()
199
203
{
204
+
if (null === $this->internalResponse) {
205
+
@trigger_error(sprintf('The %s() method calling before request() method is deprecated since 4.1 and will throw an exception in 5.0.', __METHOD__), E_USER_DEPRECATED);
206
+
}
207
+
200
208
return$this->internalResponse;
201
209
}
202
210
@@ -206,22 +214,30 @@ public function getInternalResponse()
206
214
* The origin response is the response instance that is returned
207
215
* by the code that handles requests.
208
216
*
209
-
* @return object|null A response instance
217
+
* @return object A response instance
210
218
*
211
219
* @see doRequest()
212
220
*/
213
221
publicfunctiongetResponse()
214
222
{
223
+
if (null === $this->response) {
224
+
@trigger_error(sprintf('The %s() method calling before request() method is deprecated since 4.1 and will throw an exception in 5.0.', __METHOD__), E_USER_DEPRECATED);
225
+
}
226
+
215
227
return$this->response;
216
228
}
217
229
218
230
/**
219
231
* Returns the current BrowserKit Request instance.
220
232
*
221
-
* @return Request|null A BrowserKit Request instance
233
+
* @return Request A BrowserKit Request instance
222
234
*/
223
235
publicfunctiongetInternalRequest()
224
236
{
237
+
if (null === $this->internalRequest) {
238
+
@trigger_error(sprintf('The %s() method calling before request() method is deprecated since 4.1 and will throw an exception in 5.0.', __METHOD__), E_USER_DEPRECATED);
239
+
}
240
+
225
241
return$this->internalRequest;
226
242
}
227
243
@@ -231,12 +247,16 @@ public function getInternalRequest()
231
247
* The origin request is the request instance that is sent
232
248
* to the code that handles requests.
233
249
*
234
-
* @return object|null A Request instance
250
+
* @return object A Request instance
235
251
*
236
252
* @see doRequest()
237
253
*/
238
254
publicfunctiongetRequest()
239
255
{
256
+
if (null === $this->request) {
257
+
@trigger_error(sprintf('The %s() method calling before request() method is deprecated since 4.1 and will throw an exception in 5.0.', __METHOD__), E_USER_DEPRECATED);
0 commit comments