Skip to content

Commit edfe940

Browse files
authored
V3 (#15)
1 parent eb31641 commit edfe940

File tree

6 files changed

+491
-329
lines changed

6 files changed

+491
-329
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
sudo: false
21
language: php
32
php:
43
- 7.2

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ Usage
1818

1919
```php
2020
<?php
21-
$deriver = new \webignition\AbsoluteUrlDeriver\AbsoluteUrlDeriver(
22-
'/server.php?param1=value1',
23-
'http://www.example.com/pathOne/pathTwo/pathThree'
24-
);
21+
use webignition\AbsoluteUrlDeriver\AbsoluteUrlDeriver;
22+
use webignition\Uri\Uri;
23+
24+
$base = 'https://example.com';
25+
$relative = '/path?query#fragment';
2526

26-
$this->assertEquals('http://www.example.com/server.php?param1=value1', $deriver->getAbsoluteUrl());
27+
$this->assertEquals(
28+
'https://example.com/path?query#fragment',
29+
AbsoluteUrlDeriver::derive(new Uri($base), new Uri($relative))
30+
);
2731
```
2832

2933
Building
@@ -35,7 +39,7 @@ If used as a dependency by another project, update that project's composer.json
3539
and update your dependencies.
3640

3741
"require": {
38-
"webignition/absolute-url-deriver": "*"
42+
"webignition/absolute-url-deriver": ">=3,<4"
3943
}
4044

4145
#### Developing
@@ -46,10 +50,10 @@ This project has external dependencies managed with [composer][3]. Get and insta
4650
mkdir ~/absolute-url-deriver && cd ~/absolute-url-deriver
4751

4852
# Clone repository
49-
git clone [email protected]:webignition/absolute-url-deriver.git.
53+
git clone [email protected]:webignition/absolute-url-deriver.git .
5054

5155
# Retrieve/update dependencies
52-
composer.phar install
56+
composer install
5357

5458
Testing
5559
-------

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"require": {
3333
"php": ">=7.2",
34-
"webignition/url": "^2"
34+
"webignition/uri": ">=0.3,<1"
3535
},
3636
"require-dev": {
3737
"phpunit/phpunit": "^7",

0 commit comments

Comments
 (0)