|
11 | 11 | use HTTPFriend\Tags\Css as Css; |
12 | 12 |
|
13 | 13 |
|
14 | | -class HTTPHelper { |
15 | | - |
| 14 | +class HTTPHelper |
| 15 | +{ |
| 16 | + |
16 | 17 | public $charset = "UTF-8"; |
17 | 18 | public $html; |
| 19 | + public $tag; |
| 20 | + public $CSS; |
18 | 21 |
|
19 | 22 | private $config = []; |
20 | | - |
21 | | - public function __construct( $config = [] ) |
| 23 | + |
| 24 | + public function __construct($config = []) |
22 | 25 | { |
23 | | - $this->setConfig( $config ); |
24 | | - $this->tag = $this->tag ?: new Tag; |
25 | | - $this->CSS = $this->CSS ?: new Css; |
| 26 | + $this->setConfig($config); |
| 27 | + $this->tag = $this->tag ? : new Tag; |
| 28 | + $this->CSS = $this->CSS ? : new Css; |
26 | 29 | } |
27 | 30 |
|
28 | | - public function setConfig( $config = [] ){ |
| 31 | + public function setConfig($config = []) |
| 32 | + { |
29 | 33 | $this->config = $config; |
30 | 34 | } |
31 | 35 |
|
32 | | - public function setConfigParameter( $configPart, $configSetting ){ |
33 | | - $this->config[ $configPart ] = $configSetting; |
| 36 | + public function setConfigParameter($configPart, $configSetting) |
| 37 | + { |
| 38 | + $this->config[$configPart] = $configSetting; |
34 | 39 | } |
35 | 40 |
|
36 | | - public function getConfig(){ |
| 41 | + public function getConfig() |
| 42 | + { |
37 | 43 | return $this->config; |
38 | 44 | } |
39 | 45 |
|
40 | | - public function getConfigSetting( $configPart ){ |
41 | | - return $this->config[ $configPart ]; |
| 46 | + public function getConfigSetting($configPart) |
| 47 | + { |
| 48 | + return $this->config[$configPart]; |
42 | 49 | } |
43 | | - |
44 | | - public function setHTML( $html = null ) |
| 50 | + |
| 51 | + public function setHTML($html = null) |
45 | 52 | { |
46 | 53 | $this->html = $html; |
47 | 54 | } |
48 | 55 |
|
49 | | - public function getHTML() { |
| 56 | + public function getHTML() |
| 57 | + { |
50 | 58 | return $this->html; |
51 | 59 | } |
52 | 60 |
|
53 | | - public function parseHTML(){ |
54 | | - if( isset( $this->html ) ){ |
| 61 | + public function parseHTML() |
| 62 | + { |
| 63 | + if (isset($this->html)) { |
55 | 64 |
|
56 | | - if( $this->getConfigSetting( "baseURL" ) ){ |
| 65 | + if ($this->getConfigSetting("baseURL")) { |
57 | 66 |
|
58 | | - $baseURL = $this->getConfigSetting( "baseURL" ); |
| 67 | + $baseURL = $this->getConfigSetting("baseURL"); |
59 | 68 |
|
60 | | - $this->setHTML( $this->tag->cleanURLs( $this->getHTML(), $baseURL ) ); |
| 69 | + $this->setHTML($this->tag->cleanURLs($this->getHTML(), $baseURL)); |
61 | 70 |
|
62 | | - } |
63 | | - } |
| 71 | + } |
| 72 | + } |
64 | 73 |
|
65 | 74 |
|
66 | 75 | } |
|
0 commit comments