We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
$default
Crawler::attr()
1 parent 8342592 commit 043715bCopy full SHA for 043715b
CHANGELOG.md
@@ -5,6 +5,7 @@ CHANGELOG
5
---
6
7
* Add argument `$normalizeWhitespace` to `Crawler::innerText()`
8
+ * Add argument `$default` to `Crawler::attr()`
9
10
6.4
11
Crawler.php
@@ -504,9 +504,8 @@ public function children(string $selector = null): static
504
*
505
* @throws \InvalidArgumentException When current node is empty
506
*/
507
- public function attr(string $attribute/* , string $default = null */): ?string
+ public function attr(string $attribute, string $default = null): ?string
508
{
509
- $default = \func_num_args() > 1 ? func_get_arg(1) : null;
510
if (!$this->nodes) {
511
if (null !== $default) {
512
return $default;
0 commit comments