Skip to content

Commit

Permalink
Allow Symfony 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Sep 26, 2023
1 parent 9600c2e commit 238a7ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"ext-dom": "*",
"ext-libxml": "*",
"php-webdriver/webdriver": "^1.8.2",
"symfony/browser-kit": "^5.3 || ^6.0",
"symfony/dependency-injection": "^5.3 || ^6.0",
"symfony/browser-kit": "^5.3 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.3 || ^6.0 || ^7.0",
"symfony/deprecation-contracts": "^2.4 || ^3",
"symfony/dom-crawler": "^5.3 || ^6.0",
"symfony/http-client": "^5.3 || ^6.0",
"symfony/http-kernel": "^5.3 || ^6.0",
"symfony/process": "^5.3 || ^6.0"
"symfony/dom-crawler": "^5.3 || ^6.0 || ^7.0",
"symfony/http-client": "^5.3 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.3 || ^6.0 || ^7.0",
"symfony/process": "^5.3 || ^6.0 || ^7.0"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Panther\\": "src/" }
Expand All @@ -44,9 +44,9 @@
"sort-packages": true
},
"require-dev": {
"symfony/css-selector": "^5.3 || ^6.0",
"symfony/framework-bundle": "^5.3 || ^6.0",
"symfony/mime": "^5.3 || ^6.0",
"symfony/phpunit-bridge": "^5.3 || ^6.0"
"symfony/css-selector": "^5.3 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.3 || ^6.0 || ^7.0",
"symfony/mime": "^5.3 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^5.3 || ^6.0 || ^7.0"
}
}
4 changes: 2 additions & 2 deletions src/DomCrawler/Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,14 @@ public function children(string $selector = null): static
return $this->createSubCrawlerFromXpath($xpath);
}

public function attr($attribute): ?string
public function attr($attribute, $default = null): ?string
{
$element = $this->getElementOrThrow();
if ('_text' === $attribute) {
return $this->text();
}

return (string) $element->getAttribute($attribute);
return $element->getAttribute($attribute) ?? $default;
}

public function nodeName(): string
Expand Down

0 comments on commit 238a7ba

Please sign in to comment.