Skip to content

Commit 8e26a7f

Browse files
authored
Use xparse/element-finder:2.0 (#98)
1 parent 3770334 commit 8e26a7f

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
All Notable changes to `Parser` will be documented in this file
33

44
## Planned changes
5-
- Updated minimum required version for guzzlehttp/psr7 to 2.4.5
5+
- ElementFinderFactory now accept use `Xparse\ElementFinder\ExpressionTranslator\ExpressionTranslatorInterface`
66
- Updated minimum required php version to 8.1
77
- Add `RecursiveParser` (merged from the [xparse/recursive-pagination](https://github.com/xparse/RecursivePagination) repository)
8+
- Updated minimum required version for guzzlehttp/psr7 to 2.4.5
89

910
## 1.0.2 [2023-12-5]
1011
- Minimum supported php version is now php 8.0

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"guzzlehttp/guzzle": "^6.3 || ^7.3",
2424
"guzzlehttp/psr7": "^2.4.5",
2525
"psr/http-message": "^1.0",
26-
"xparse/element-finder": "0.* || ^1.0.0",
27-
"xparse/expression-translator": "0.0.* || ^1.0.0"
26+
"xparse/element-finder": "^2.0"
2827
},
2928
"require-dev": {
3029
"ext-iconv": "*",

src/ElementFinderFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
use Psr\Http\Message\ResponseInterface;
99
use Xparse\ElementFinder\ElementFinder;
1010
use Xparse\ElementFinder\ElementFinderInterface;
11+
use Xparse\ElementFinder\ExpressionTranslator\ExpressionTranslatorInterface;
12+
use Xparse\ElementFinder\ExpressionTranslator\XpathExpression;
1113
use Xparse\ElementFinder\Helper\StringHelper;
12-
use Xparse\ExpressionTranslator\ExpressionTranslatorInterface;
13-
use Xparse\ExpressionTranslator\XpathExpression;
1414
use Xparse\Parser\Helper\EncodingConverterInterface;
1515
use Xparse\Parser\Helper\LinkConverterInterface;
1616
use Xparse\Parser\Helper\RelativeToAbsoluteLinkConverter;

tests/Helper/LinkConverterTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ public function getConvertRelativeUrlToAbsolute(): array
3232
'url' => 'http://funivan.com/userName',
3333
],
3434
[
35-
'html' => '<img src="/hello.jpg"/>',
36-
'expect' => '<img src="http://funivan.com/hello.jpg"/>',
35+
'html' => '<img src="/hello.jpg">',
36+
'expect' => '<img src="http://funivan.com/hello.jpg">',
3737
'url' => 'http://funivan.com/userName',
3838
],
3939
[
40-
'html' => '<img src="hello.jpg"/>',
41-
'expect' => '<img src="http://funivan.com/userName/hello.jpg"/>',
40+
'html' => '<img src="hello.jpg">',
41+
'expect' => '<img src="http://funivan.com/userName/hello.jpg">',
4242
'url' => 'http://funivan.com/userName/',
4343
],
4444
[
@@ -68,14 +68,14 @@ public function getConvertRelativeUrlToAbsolute(): array
6868
],
6969
[
7070
'html' => '<head><base href="http://www.example.com/images/" target="_blank"></head>
71-
<body><img src="stickman.gif" width="24" height="39" alt="Stickman"/></body>',
72-
'expect' => '<img src="http://www.example.com/images/stickman.gif" width="24" height="39" alt="Stickman"/>',
71+
<body><img src="stickman.gif" width="24" height="39" alt="Stickman"></body>',
72+
'expect' => '<img src="http://www.example.com/images/stickman.gif" width="24" height="39" alt="Stickman">',
7373
'url' => 'http://www.example.com/',
7474
],
7575
[
7676
'html' => '<head><base href="http://www.example.com/data/images/" target="_blank"></head>
77-
<body><img src="../stickman.gif" width="24" height="39" alt="Stickman"/></body>',
78-
'expect' => '<img src="http://www.example.com/data/stickman.gif" width="24" height="39" alt="Stickman"/>',
77+
<body><img src="../stickman.gif" width="24" height="39" alt="Stickman"></body>',
78+
'expect' => '<img src="http://www.example.com/data/stickman.gif" width="24" height="39" alt="Stickman">',
7979
'url' => 'http://www.example.com/',
8080
],
8181
[

0 commit comments

Comments
 (0)