Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba30cb1

Browse files
committed
[DomCrawler] Rename UriExpander.php -> UriResolver
1 parent 9eb7cb1 commit ba30cb1

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/Symfony/Component/DomCrawler/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CHANGELOG
55
-----
66

77
* Added an internal cache layer on top of the CssSelectorConverter
8-
* Added `UriExpander` to expand an URL according to another URL
8+
* Added `UriResolved` to resolve an URI according to another URI
99

1010
5.0.0
1111
-----

src/Symfony/Component/DomCrawler/Tests/UriExpanderTest.php renamed to src/Symfony/Component/DomCrawler/Tests/UriResolverTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
namespace Symfony\Component\DomCrawler\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Component\DomCrawler\UriExpander;
15+
use Symfony\Component\DomCrawler\UriResolver;
1616

17-
class UriExpanderTest extends TestCase
17+
class UriResolverTest extends TestCase
1818
{
1919
/**
20-
* @dataProvider provideExpandUriTests
20+
* @dataProvider provideResolverTests
2121
*/
22-
public function testExpandUri(string $uri, string $currentUri, string $expected)
22+
public function testResolver(string $uri, string $currentUri, string $expected)
2323
{
24-
$this->assertEquals($expected, UriExpander::expand($uri, $currentUri));
24+
$this->assertEquals($expected, UriResolver::resolve($uri, $currentUri));
2525
}
2626

27-
public function provideExpandUriTests()
27+
public function provideResolverTests()
2828
{
2929
return [
3030
['/foo', 'http://localhost/bar/foo/', 'http://localhost/foo'],

src/Symfony/Component/DomCrawler/UriExpander.php renamed to src/Symfony/Component/DomCrawler/UriResolver.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@
1212
namespace Symfony\Component\DomCrawler;
1313

1414
/**
15-
* Expand an URI according a current URI.
15+
* The UriResolver class takes an URI (relative, absolute, fragment, etc.)
16+
* and turns it into an absolute URI against another given base URI.
1617
*
1718
* @author Fabien Potencier <[email protected]>
1819
* @author Grégoire Pineau <[email protected]>
1920
*/
20-
class UriExpander
21+
class UriResolver
2122
{
2223
/**
23-
* Expand an URI according to a current Uri.
24+
* Resolve an URI according to a current Uri.
2425
*
2526
* For example if $uri=/foo/bar and $currentUri=https://symfony.com it will
2627
* return https://symfony.com/foo/bar
2728
*
2829
* If the $uri is not absolute you must pass an absolute $currentUri
2930
*/
30-
public static function expand(string $uri, ?string $currentUri): string
31+
public static function resolve(string $uri, ?string $currentUri): string
3132
{
3233
$uri = trim($uri);
3334

0 commit comments

Comments
 (0)