Skip to content

Commit 42fa78d

Browse files
committed
Add compatibility layer
1 parent 7bf0ff5 commit 42fa78d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Symfony/Component/BrowserKit/AbstractBrowser.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,13 @@ public function getRequest(): object
283283

284284
/**
285285
* Clicks on a given link.
286+
*
287+
* @param array $serverParameters An array of server parameters
286288
*/
287-
public function click(Link $link, array $serverParameters = []): Crawler
289+
public function click(Link $link/* , array $serverParameters = [] */): Crawler
288290
{
291+
$serverParameters = 2 === \func_num_args() ? func_get_arg(1) : [];
292+
289293
if ($link instanceof Form) {
290294
return $this->submit($link, [], $serverParameters);
291295
}
@@ -299,8 +303,10 @@ public function click(Link $link, array $serverParameters = []): Crawler
299303
* @param string $linkText The text of the link or the alt attribute of the clickable image
300304
* @param array $serverParameters An array of server parameters
301305
*/
302-
public function clickLink(string $linkText, array $serverParameters = []): Crawler
306+
public function clickLink(string $linkText/* , array $serverParameters = [] */): Crawler
303307
{
308+
$serverParameters = 2 === \func_num_args() ? func_get_arg(1) : [];
309+
304310
if (null === $this->crawler) {
305311
throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
306312
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy