Skip to content

Commit fd03f05

Browse files
author
Christoph Singer
committed
Make it compatible with Symfony 6
1 parent f46c0f9 commit fd03f05

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Tests/HtmlPageCrawlerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ public function testWrap()
375375

376376
$c = new HtmlPageCrawler('plain text node');
377377
$c->wrap('<div class="ic"></div>');
378-
$this->assertEquals('<div class="ic">plain text node</div>', $c->parents()->eq(0)->saveHTML());
378+
$this->assertEquals('<div class="ic">plain text node</div>', $c->ancestors()->eq(0)->saveHTML());
379379

380380
$c = HtmlPageCrawler::create('<div>');
381381
$m = HtmlPageCrawler::create('message 1')->appendTo($c);

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"ext-dom":"*",
1818
"ext-libxml":"*",
1919
"ext-mbstring":"*",
20-
"symfony/dom-crawler":"^4.4|^5",
21-
"symfony/css-selector":"^4.4|^5"
20+
"symfony/dom-crawler":"^4.4|^5|^6",
21+
"symfony/css-selector":"^4.4|^5|^6"
2222
},
2323
"require-dev": {
2424
"phpunit/phpunit": "^9",

src/HtmlPageCrawler.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ public function getDOMDocument()
891891
* @param string $selector
892892
* @return HtmlPageCrawler
893893
*/
894-
public function filter($selector)
894+
public function filter(string $selector): static
895895
{
896896
return parent::filter($selector);
897897
}
@@ -905,7 +905,7 @@ public function filter($selector)
905905
*
906906
* @api
907907
*/
908-
public function filterXPath($xpath)
908+
public function filterXPath($xpath): static
909909
{
910910
return parent::filterXPath($xpath);
911911
}

0 commit comments

Comments
 (0)