Skip to content

Commit f676209

Browse files
committed
Fix CS violations
1 parent 9d1dd20 commit f676209

File tree

10 files changed

+112
-67
lines changed

10 files changed

+112
-67
lines changed

src/Pdp/HttpAdapter/CurlHttpAdapter.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
<?php
22

33
/**
4-
* PHP Domain Parser: Public Suffix List based URL parsing
4+
* PHP Domain Parser: Public Suffix List based URL parsing.
55
*
66
* @link http://github.com/jeremykendall/php-domain-parser for the canonical source repository
7+
*
78
* @copyright Copyright (c) 2014 Jeremy Kendall (http://about.me/jeremykendall)
89
* @license http://github.com/jeremykendall/php-domain-parser/blob/master/LICENSE MIT License
910
*/
11+
1012
namespace Pdp\HttpAdapter;
1113

1214
/**
13-
* cURL http adapter
15+
* cURL http adapter.
1416
*
1517
* Lifted pretty much completely from William Durand's excellent Geocoder
1618
* project
19+
*
1720
* @link https://github.com/willdurand/Geocoder Geocoder on GitHub
21+
*
1822
* @author William Durand <[email protected]>
1923
* @author Jeremy Kendall <[email protected]>
2024
*/

src/Pdp/HttpAdapter/HttpAdapterInterface.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
<?php
22

33
/**
4-
* PHP Domain Parser: Public Suffix List based URL parsing
4+
* PHP Domain Parser: Public Suffix List based URL parsing.
55
*
66
* @link http://github.com/jeremykendall/php-domain-parser for the canonical source repository
7+
*
78
* @copyright Copyright (c) 2014 Jeremy Kendall (http://about.me/jeremykendall)
89
* @license http://github.com/jeremykendall/php-domain-parser/blob/master/LICENSE MIT License
910
*/
11+
1012
namespace Pdp\HttpAdapter;
1113

1214
/**
13-
* Interface for http adapters
15+
* Interface for http adapters.
1416
*
1517
* Lifted pretty much completely from William Durand's excellent Geocoder
1618
* project
19+
*
1720
* @link https://github.com/willdurand/Geocoder Geocoder on GitHub
21+
*
1822
* @author William Durand <[email protected]>
1923
* @author Jeremy Kendall <[email protected]>
2024
*/
@@ -23,7 +27,8 @@ interface HttpAdapterInterface
2327
/**
2428
* Returns the content fetched from a given URL.
2529
*
26-
* @param string $url
30+
* @param string $url
31+
*
2732
* @return string Retrieved content
2833
*/
2934
public function getContent($url);

src/Pdp/Parser.php

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<?php
22

33
/**
4-
* PHP Domain Parser: Public Suffix List based URL parsing
4+
* PHP Domain Parser: Public Suffix List based URL parsing.
55
*
66
* @link http://github.com/jeremykendall/php-domain-parser for the canonical source repository
7+
*
78
* @copyright Copyright (c) 2014 Jeremy Kendall (http://about.me/jeremykendall)
89
* @license http://github.com/jeremykendall/php-domain-parser/blob/master/LICENSE MIT License
910
*/
11+
1012
namespace Pdp;
1113

1214
use Pdp\Uri\Url;
1315
use Pdp\Uri\Url\Host;
1416

1517
/**
16-
* Parser
18+
* Parser.
1719
*
1820
* This class is reponsible for Public Suffix List based url parsing
1921
*/
@@ -33,9 +35,10 @@ class Parser
3335
protected $isNormalized = false;
3436

3537
/**
36-
* Public constructor
38+
* Public constructor.
3739
*
3840
* @codeCoverageIgnore
41+
*
3942
* @param PublicSuffixList $publicSuffixList Instance of PublicSuffixList
4043
*/
4144
public function __construct(PublicSuffixList $publicSuffixList)
@@ -44,10 +47,11 @@ public function __construct(PublicSuffixList $publicSuffixList)
4447
}
4548

4649
/**
47-
* Parses url
50+
* Parses url.
51+
*
52+
* @param string $url Url to parse
4853
*
49-
* @param string $url Url to parse
50-
* @return Url Object representation of url
54+
* @return Url Object representation of url
5155
*/
5256
public function parseUrl($url)
5357
{
@@ -89,10 +93,11 @@ public function parseUrl($url)
8993
}
9094

9195
/**
92-
* Parses host part of url
96+
* Parses host part of url.
9397
*
94-
* @param string $host Host part of url
95-
* @return Host Object representation of host portion of url
98+
* @param string $host Host part of url
99+
*
100+
* @return Host Object representation of host portion of url
96101
*/
97102
public function parseHost($host)
98103
{
@@ -121,9 +126,10 @@ public function parseHost($host)
121126

122127
/**
123128
* Get the raw public suffix based on the cached public suffix list file.
124-
* Return false if the provided suffix is not included in the PSL
129+
* Return false if the provided suffix is not included in the PSL.
130+
*
131+
* @param string $host The host to process
125132
*
126-
* @param string $host The host to process
127133
* @return string|false The suffix or false if suffix not included in the PSL
128134
*/
129135
protected function getRawPublicSuffix($host)
@@ -173,9 +179,10 @@ protected function getRawPublicSuffix($host)
173179
}
174180

175181
/**
176-
* Returns the public suffix portion of provided host
182+
* Returns the public suffix portion of provided host.
183+
*
184+
* @param string $host host
177185
*
178-
* @param string $host host
179186
* @return string|null public suffix or null if host does not contain a public suffix
180187
*/
181188
public function getPublicSuffix($host)
@@ -212,22 +219,24 @@ public function getPublicSuffix($host)
212219
*
213220
* Validity determined by whether or not the suffix is included in the PSL.
214221
*
215-
* @param string $host Host part
216-
* @return bool True is suffix is valid, false otherwise
222+
* @param string $host Host part
223+
*
224+
* @return bool True is suffix is valid, false otherwise
217225
*/
218226
public function isSuffixValid($host)
219227
{
220228
return $this->getRawPublicSuffix($host) !== false;
221229
}
222230

223231
/**
224-
* Returns registerable domain portion of provided host
232+
* Returns registerable domain portion of provided host.
225233
*
226234
* Per the test cases provided by Mozilla
227235
* (http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1),
228236
* this method should return null if the domain provided is a public suffix.
229237
*
230-
* @param string $host host
238+
* @param string $host host
239+
*
231240
* @return string registerable domain
232241
*/
233242
public function getRegisterableDomain($host)
@@ -250,9 +259,10 @@ public function getRegisterableDomain($host)
250259
}
251260

252261
/**
253-
* Returns the subdomain portion of provided host
262+
* Returns the subdomain portion of provided host.
263+
*
264+
* @param string $host host
254265
*
255-
* @param string $host host
256266
* @return string subdomain
257267
*/
258268
public function getSubdomain($host)
@@ -279,7 +289,8 @@ public function getSubdomain($host)
279289
* If a URL is not punycoded, then it may be an IDNA URL, so it must be
280290
* converted to ASCII. Performs conversion and sets flag.
281291
*
282-
* @param string $part Host part
292+
* @param string $part Host part
293+
*
283294
* @return string Host part, transformed if not punycoded
284295
*/
285296
protected function normalize($part)
@@ -298,7 +309,8 @@ protected function normalize($part)
298309
* Converts any normalized part back to IDNA. Performs conversion and
299310
* resets flag.
300311
*
301-
* @param string $part Host part
312+
* @param string $part Host part
313+
*
302314
* @return string Denormalized host part
303315
*/
304316
protected function denormalize($part)
@@ -312,25 +324,27 @@ protected function denormalize($part)
312324
}
313325

314326
/**
315-
* Tests host for presence of '.'
327+
* Tests host for presence of '.'.
316328
*
317329
* Related to #22
318330
*
319-
* @param string $host Host part of url
320-
* @return bool True if multi-label domain, false otherwise
331+
* @param string $host Host part of url
332+
*
333+
* @return bool True if multi-label domain, false otherwise
321334
*/
322335
protected function isMutliLabelDomain($host)
323336
{
324337
return strpos($host, '.') !== false;
325338
}
326339

327340
/**
328-
* Tests host to determine if it is an IP address
341+
* Tests host to determine if it is an IP address.
329342
*
330343
* Related to #43
331344
*
332-
* @param string $host Host part of url
333-
* @return bool True if host is an ip address, false otherwise
345+
* @param string $host Host part of url
346+
*
347+
* @return bool True if host is an ip address, false otherwise
334348
*/
335349
protected function isIpv4Address($host)
336350
{

src/Pdp/PublicSuffixList.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
<?php
22

33
/**
4-
* PHP Domain Parser: Public Suffix List based URL parsing
4+
* PHP Domain Parser: Public Suffix List based URL parsing.
55
*
66
* @link http://github.com/jeremykendall/php-domain-parser for the canonical source repository
7+
*
78
* @copyright Copyright (c) 2014 Jeremy Kendall (http://about.me/jeremykendall)
89
* @license http://github.com/jeremykendall/php-domain-parser/blob/master/LICENSE MIT License
910
*/
11+
1012
namespace Pdp;
1113

1214
/**
13-
* Public Suffix List
15+
* Public Suffix List.
1416
*/
1517
class PublicSuffixList extends \ArrayObject
1618
{
1719
/**
18-
* Public constructor
20+
* Public constructor.
1921
*
2022
* @param mixed $list Array representing Public Suffix List or PHP Public Suffix List file
2123
*/

0 commit comments

Comments
 (0)