Skip to content

Commit a210b0a

Browse files
paquettg=
authored andcommitted
Reformated code to comply with PSR-1/2
1 parent f576e73 commit a210b0a

22 files changed

+2814
-3024
lines changed

src/PHPHtmlParser/Content.php

Lines changed: 243 additions & 258 deletions
Large diffs are not rendered by default.

src/PHPHtmlParser/Curl.php

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,34 @@
88
*
99
* @package PHPHtmlParser
1010
*/
11-
class Curl implements CurlInterface {
11+
class Curl implements CurlInterface
12+
{
1213

13-
/**
14-
* A simple curl implementation to get the content of the url.
15-
*
16-
* @param string $url
17-
* @return string
18-
* @throws CurlException
19-
*/
20-
public function get($url)
21-
{
22-
$ch = curl_init($url);
14+
/**
15+
* A simple curl implementation to get the content of the url.
16+
*
17+
* @param string $url
18+
* @return string
19+
* @throws CurlException
20+
*/
21+
public function get($url)
22+
{
23+
$ch = curl_init($url);
2324

24-
if ( ! ini_get('open_basedir'))
25-
{
26-
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
27-
}
25+
if ( ! ini_get('open_basedir')) {
26+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
27+
}
2828

29-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
30-
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
29+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
30+
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
3131

32-
$content = curl_exec($ch);
33-
if ($content === false)
34-
{
35-
// there was a problem
36-
$error = curl_error($ch);
37-
throw new CurlException('Error retrieving "'.$url.'" ('.$error.')');
38-
}
32+
$content = curl_exec($ch);
33+
if ($content === false) {
34+
// there was a problem
35+
$error = curl_error($ch);
36+
throw new CurlException('Error retrieving "'.$url.'" ('.$error.')');
37+
}
3938

40-
return $content;
41-
}
39+
return $content;
40+
}
4241
}

src/PHPHtmlParser/CurlInterface.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
*
77
* @package PHPHtmlParser
88
*/
9-
interface CurlInterface {
9+
interface CurlInterface
10+
{
1011

11-
/**
12-
* This method should return the content of the url in a string
13-
*
14-
* @param string $url
15-
* @return string
16-
*/
17-
public function get($url);
12+
/**
13+
* This method should return the content of the url in a string
14+
*
15+
* @param string $url
16+
* @return string
17+
*/
18+
public function get($url);
1819
}

0 commit comments

Comments
 (0)