Skip to content

Commit c53a6e9

Browse files
committed
clean up method argument handling
1 parent e77088a commit c53a6e9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

AbstractBrowser.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,8 @@ public function getRequest(): object
254254
*
255255
* @param array $serverParameters An array of server parameters
256256
*/
257-
public function click(Link $link/* , array $serverParameters = [] */): Crawler
257+
public function click(Link $link, array $serverParameters = []): Crawler
258258
{
259-
$serverParameters = 1 < \func_num_args() ? func_get_arg(1) : [];
260-
261259
if ($link instanceof Form) {
262260
return $this->submit($link, [], $serverParameters);
263261
}
@@ -271,10 +269,8 @@ public function click(Link $link/* , array $serverParameters = [] */): Crawler
271269
* @param string $linkText The text of the link or the alt attribute of the clickable image
272270
* @param array $serverParameters An array of server parameters
273271
*/
274-
public function clickLink(string $linkText/* , array $serverParameters = [] */): Crawler
272+
public function clickLink(string $linkText, array $serverParameters = []): Crawler
275273
{
276-
$serverParameters = 1 < \func_num_args() ? func_get_arg(1) : [];
277-
278274
$crawler = $this->crawler ?? throw new BadMethodCallException(sprintf('The "request()" method must be called before "%s()".', __METHOD__));
279275

280276
return $this->click($crawler->selectLink($linkText)->link(), $serverParameters);

0 commit comments

Comments
 (0)