Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 94af00e

Browse filesBrowse files
[DomCrawler] Add argument $default to Crawler::attr()
1 parent 83e102b commit 94af00e
Copy full SHA for 94af00e

File tree

3 files changed

+3
-2
lines changed
Filter options

3 files changed

+3
-2
lines changed

‎UPGRADE-7.0.md

Copy file name to clipboardExpand all lines: UPGRADE-7.0.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ DomCrawler
156156
----------
157157

158158
* Add argument `$normalizeWhitespace` to `Crawler::innerText()`
159+
* Add argument `$default` to `Crawler::attr()`
159160

160161
ExpressionLanguage
161162
------------------

‎src/Symfony/Component/DomCrawler/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Add argument `$normalizeWhitespace` to `Crawler::innerText()`
8+
* Add argument `$default` to `Crawler::attr()`
89

910
6.4
1011
---

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,8 @@ public function children(string $selector = null): static
504504
*
505505
* @throws \InvalidArgumentException When current node is empty
506506
*/
507-
public function attr(string $attribute/* , string $default = null */): ?string
507+
public function attr(string $attribute, string $default = null): ?string
508508
{
509-
$default = \func_num_args() > 1 ? func_get_arg(1) : null;
510509
if (!$this->nodes) {
511510
if (null !== $default) {
512511
return $default;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.