@@ -204,7 +204,7 @@ public function getCookieJar(): CookieJar
204204 */
205205 public function getCrawler (): Crawler
206206 {
207- return $ this ->crawler ?? throw new BadMethodCallException (sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
207+ return $ this ->crawler ?? throw new BadMethodCallException (\ sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
208208 }
209209
210210 /**
@@ -224,7 +224,7 @@ public function useHtml5Parser(bool $useHtml5Parser): static
224224 */
225225 public function getInternalResponse (): Response
226226 {
227- return $ this ->internalResponse ?? throw new BadMethodCallException (sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
227+ return $ this ->internalResponse ?? throw new BadMethodCallException (\ sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
228228 }
229229
230230 /**
@@ -237,15 +237,15 @@ public function getInternalResponse(): Response
237237 */
238238 public function getResponse (): object
239239 {
240- return $ this ->response ?? throw new BadMethodCallException (sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
240+ return $ this ->response ?? throw new BadMethodCallException (\ sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
241241 }
242242
243243 /**
244244 * Returns the current BrowserKit Request instance.
245245 */
246246 public function getInternalRequest (): Request
247247 {
248- return $ this ->internalRequest ?? throw new BadMethodCallException (sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
248+ return $ this ->internalRequest ?? throw new BadMethodCallException (\ sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
249249 }
250250
251251 /**
@@ -258,7 +258,7 @@ public function getInternalRequest(): Request
258258 */
259259 public function getRequest (): object
260260 {
261- return $ this ->request ?? throw new BadMethodCallException (sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
261+ return $ this ->request ?? throw new BadMethodCallException (\ sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
262262 }
263263
264264 /**
@@ -287,7 +287,7 @@ public function clickLink(string $linkText/* , array $serverParameters = [] */):
287287 {
288288 $ serverParameters = 1 < \func_num_args () ? func_get_arg (1 ) : [];
289289
290- $ crawler = $ this ->crawler ?? throw new BadMethodCallException (sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
290+ $ crawler = $ this ->crawler ?? throw new BadMethodCallException (\ sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
291291
292292 return $ this ->click ($ crawler ->selectLink ($ linkText )->link (), $ serverParameters );
293293 }
@@ -316,11 +316,11 @@ public function submit(Form $form, array $values = [], array $serverParameters =
316316 */
317317 public function submitForm (string $ button , array $ fieldValues = [], string $ method = 'POST ' , array $ serverParameters = []): Crawler
318318 {
319- $ crawler = $ this ->crawler ?? throw new BadMethodCallException (sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
319+ $ crawler = $ this ->crawler ?? throw new BadMethodCallException (\ sprintf ('The "request()" method must be called before "%s()". ' , __METHOD__ ));
320320 $ buttonNode = $ crawler ->selectButton ($ button );
321321
322322 if (0 === $ buttonNode ->count ()) {
323- throw new InvalidArgumentException (sprintf ('There is no button with "%s" as its content, id, value or name. ' , $ button ));
323+ throw new InvalidArgumentException (\ sprintf ('There is no button with "%s" as its content, id, value or name. ' , $ button ));
324324 }
325325
326326 $ form = $ buttonNode ->form ($ fieldValues , $ method );
@@ -444,7 +444,7 @@ protected function doRequestInProcess(object $request)
444444 }
445445
446446 if (!$ process ->isSuccessful () || !preg_match ('/^O\:\d+\:/ ' , $ process ->getOutput ())) {
447- throw new RuntimeException (sprintf ('OUTPUT: %s ERROR OUTPUT: %s. ' , $ process ->getOutput (), $ process ->getErrorOutput ()));
447+ throw new RuntimeException (\ sprintf ('OUTPUT: %s ERROR OUTPUT: %s. ' , $ process ->getOutput (), $ process ->getErrorOutput ()));
448448 }
449449
450450 return unserialize ($ process ->getOutput ());
@@ -554,7 +554,7 @@ public function followRedirect(): Crawler
554554 if (-1 !== $ this ->maxRedirects ) {
555555 if ($ this ->redirectCount > $ this ->maxRedirects ) {
556556 $ this ->redirectCount = 0 ;
557- throw new LogicException (sprintf ('The maximum number (%d) of redirections was reached. ' , $ this ->maxRedirects ));
557+ throw new LogicException (\ sprintf ('The maximum number (%d) of redirections was reached. ' , $ this ->maxRedirects ));
558558 }
559559 }
560560
@@ -630,7 +630,7 @@ protected function getAbsoluteUri(string $uri): string
630630 if (!$ this ->history ->isEmpty ()) {
631631 $ currentUri = $ this ->history ->current ()->getUri ();
632632 } else {
633- $ currentUri = sprintf ('http%s://%s/ ' ,
633+ $ currentUri = \ sprintf ('http%s://%s/ ' ,
634634 isset ($ this ->server ['HTTPS ' ]) ? 's ' : '' ,
635635 $ this ->server ['HTTP_HOST ' ] ?? 'localhost '
636636 );
0 commit comments