Skip to content

Commit bd572bd

Browse files
committed
Merge branch 'develop'
2 parents 896e7e7 + 151e09c commit bd572bd

26 files changed

+13953
-405
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
tags
2-
data/*.txt
32
composer.lock
43
vendor
54
*.swp
65
docs
76
*~
87
build
8+
.idea

.php_cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ $finder = \Symfony\CS\Finder\DefaultFinder::create()
99
return \Symfony\CS\Config\Config::create()
1010
->setUsingCache(true)
1111
->fixers([
12+
'-pre_increment',
1213
'-concat_without_spaces',
1314
'concat_with_spaces',
1415
'ordered_use',
16+
'long_array_syntax',
1517
])
1618
->finder($finder);

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ php:
55
- 5.4
66
- 5.5
77
- 5.6
8+
- 7.0
89
- hhvm
910

1011
script: phpunit

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ domain parser implemented in PHP.
1111

1212
While there are plenty of excellent URL parsers and builders available, there
1313
are very few projects that can accurately parse a url into its component
14-
subdomain, registerable domain, and public suffix parts.
14+
subdomain, registrable domain, and public suffix parts.
1515

1616
Consider the domain www.pref.okinawa.jp. In this domain, the
17-
*public suffix* portion is **okinawa.jp**, the *registerable domain* is
17+
*public suffix* portion is **okinawa.jp**, the *registrable domain* is
1818
**pref.okinawa.jp**, and the *subdomain* is **www**. You can't regex that.
1919

2020
Other similar libraries focus primarily on URL building, parsing, and
@@ -77,7 +77,7 @@ class Pdp\Uri\Url#6 (8) {
7777
class Pdp\Uri\Url\Host#5 (3) {
7878
private $subdomain =>
7979
string(3) "www"
80-
private $registerableDomain =>
80+
private $registrableDomain =>
8181
string(15) "pref.okinawa.jp"
8282
private $publicSuffix =>
8383
string(10) "okinawa.jp"
@@ -139,7 +139,7 @@ class Pdp\Uri\Url#6 (8) {
139139
class Pdp\Uri\Url\Host#5 (4) {
140140
private $subdomain =>
141141
NULL
142-
private $registerableDomain =>
142+
private $registrableDomain =>
143143
string(17) "яндекс.рф"
144144
private $publicSuffix =>
145145
string(4) "рф"
@@ -175,7 +175,7 @@ class Pdp\Uri\Url#6 (8) {
175175
class Pdp\Uri\Url\Host#5 (4) {
176176
private $subdomain =>
177177
NULL
178-
private $registerableDomain =>
178+
private $registrableDomain =>
179179
string(22) "xn--d1acpjx3f.xn--p1ai"
180180
private $publicSuffix =>
181181
string(8) "xn--p1ai"
@@ -211,7 +211,7 @@ class Pdp\Uri\Url#6 (8) {
211211
class Pdp\Uri\Url\Host#5 (4) {
212212
private $subdomain =>
213213
NULL
214-
private $registerableDomain =>
214+
private $registrableDomain =>
215215
NULL
216216
private $publicSuffix =>
217217
NULL
@@ -257,7 +257,7 @@ The above will output:
257257
class Pdp\Uri\Url\Host#7 (3) {
258258
private $subdomain =>
259259
string(1) "a"
260-
private $registerableDomain =>
260+
private $registrableDomain =>
261261
string(6) "b.c.cy"
262262
private $publicSuffix =>
263263
string(4) "c.cy"
@@ -292,7 +292,7 @@ retrieve only the component you're interested in
292292
<?php
293293

294294
var_dump($parser->getSubdomain('www.scottwills.co.uk'));
295-
var_dump($parser->getRegisterableDomain('www.scottwills.co.uk'));
295+
var_dump($parser->getRegistrableDomain('www.scottwills.co.uk'));
296296
var_dump($parser->getPublicSuffix('www.scottwills.co.uk'));
297297
```
298298

@@ -331,7 +331,7 @@ Array
331331
[pass] =>
332332
[host] => www.waxaudio.com.au
333333
[subdomain] => www
334-
[registerableDomain] => waxaudio.com.au
334+
[registrableDomain] => waxaudio.com.au
335335
[publicSuffix] => com.au
336336
[port] =>
337337
[path] => /

bin/parse

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ try {
2323
$manager = new \Pdp\PublicSuffixListManager();
2424
$parser = new Pdp\Parser($manager->getList());
2525
$url = $parser->parseUrl($domain);
26-
$suffixValid = ($parser->isSuffixValid((string) $url->host)) ? 'IS' : 'IS NOT';
26+
$suffixValid = ($parser->isSuffixValid((string) $url->getHost())) ? 'IS' : 'IS NOT';
2727

2828
print_r($url->toArray());
2929
echo sprintf('Host: %s', $url) . PHP_EOL;
3030
echo sprintf(
3131
"'%s' %s a valid public suffix.",
32-
$url->host->publicSuffix,
32+
$url->getHost()->getPublicSuffix(),
3333
$suffixValid
3434
) . PHP_EOL;
3535
} catch (\Exception $e) {

build.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
<exec
1515
passthru="${passthru}"
1616
dir="${project.basedir}"
17-
command="phpunit" />
17+
command="./vendor/bin/phpunit" />
1818
</target>
1919

2020
<target name="php-cs-fixer" description="PHP Codings Standards fixer">
2121
<exec
2222
passthru="${passthru}"
23-
command="php-cs-fixer --verbose fix" />
23+
command="./vendor/bin/php-cs-fixer fix --config-file=.php_cs --verbose" />
2424
</target>
2525

2626
<target name="phpdoc" description="Generate API documentation">
@@ -39,6 +39,5 @@
3939
<phingCall target="clean" />
4040
<phingCall target="php-cs-fixer" />
4141
<phingCall target="phpunit" />
42-
<phingCall target="phpdoc" />
4342
</target>
4443
</project>

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@
3434
"ext-mbstring": "*"
3535
},
3636
"require-dev": {
37-
"mikey179/vfsStream": "~1.4",
38-
"phpunit/phpunit": "~4.4",
39-
"jeremykendall/debug-die": "0.0.1.*"
37+
"mikey179/vfsStream": "~1.6",
38+
"phpunit/phpunit": "~4.8",
39+
"jeremykendall/debug-die": "0.0.1.*",
40+
"phing/phing": "^2.13",
41+
"fabpot/php-cs-fixer": "^1.11"
4042
},
4143
"autoload": {
4244
"psr-0": {

0 commit comments

Comments
 (0)