@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param bool $enabled |
69 | 69 | * @return ConvertHelper_URLFinder |
70 | 70 | */ |
71 | - public function enableSorting(bool $enabled=true) : ConvertHelper_URLFinder |
|
71 | + public function enableSorting(bool $enabled = true) : ConvertHelper_URLFinder |
|
72 | 72 | { |
73 | 73 | $this->setOption('sorting', $enabled); |
74 | 74 | return $this; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @param bool $include |
83 | 83 | * @return ConvertHelper_URLFinder |
84 | 84 | */ |
85 | - public function includeEmails(bool $include=true) : ConvertHelper_URLFinder |
|
85 | + public function includeEmails(bool $include = true) : ConvertHelper_URLFinder |
|
86 | 86 | { |
87 | 87 | $this->setOption('include-emails', $include); |
88 | 88 | return $this; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param bool $omit |
95 | 95 | * @return ConvertHelper_URLFinder |
96 | 96 | */ |
97 | - public function omitMailto(bool $omit=true) : ConvertHelper_URLFinder |
|
97 | + public function omitMailto(bool $omit = true) : ConvertHelper_URLFinder |
|
98 | 98 | { |
99 | 99 | $this->setOption('omit-mailto', $omit); |
100 | 100 | return $this; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | $replaces = array(); |
111 | 111 | |
112 | - foreach($this->schemes as $scheme) |
|
112 | + foreach ($this->schemes as $scheme) |
|
113 | 113 | { |
114 | 114 | $replaces[$scheme.':'] = PHP_EOL.$scheme.':'; |
115 | 115 | } |
@@ -131,20 +131,20 @@ discard block |
||
131 | 131 | |
132 | 132 | $result = array(); |
133 | 133 | |
134 | - foreach($matches[0] as $match) |
|
134 | + foreach ($matches[0] as $match) |
|
135 | 135 | { |
136 | - if(strstr($match, '://') && !in_array($match, $result)) |
|
136 | + if (strstr($match, '://') && !in_array($match, $result)) |
|
137 | 137 | { |
138 | 138 | $result[] = $match; |
139 | 139 | } |
140 | 140 | } |
141 | 141 | |
142 | - if($this->getBoolOption('include-emails')) |
|
142 | + if ($this->getBoolOption('include-emails')) |
|
143 | 143 | { |
144 | 144 | $result = array_merge($result, $this->getEmails()); |
145 | 145 | } |
146 | 146 | |
147 | - if($this->getBoolOption('sorting')) |
|
147 | + if ($this->getBoolOption('sorting')) |
|
148 | 148 | { |
149 | 149 | usort($result, function(string $a, string $b) { |
150 | 150 | return strnatcasecmp($a, $b); |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | $result = array(); |
170 | 170 | $prefix = $this->getEmailPrefix(); |
171 | 171 | |
172 | - foreach($matches[0] as $email) |
|
172 | + foreach ($matches[0] as $email) |
|
173 | 173 | { |
174 | 174 | $result[] = $prefix.$email; |
175 | 175 | } |
176 | 176 | |
177 | - if($this->getBoolOption('sorting')) |
|
177 | + if ($this->getBoolOption('sorting')) |
|
178 | 178 | { |
179 | 179 | usort($result, function(string $a, string $b) { |
180 | 180 | return strnatcasecmp($a, $b); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | private function getEmailPrefix() : string |
188 | 188 | { |
189 | - if($this->getBoolOption('omit-mailto')) |
|
189 | + if ($this->getBoolOption('omit-mailto')) |
|
190 | 190 | { |
191 | 191 | return ''; |
192 | 192 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | $result = array(); |
207 | 207 | |
208 | - foreach($urls as $url) |
|
208 | + foreach ($urls as $url) |
|
209 | 209 | { |
210 | 210 | $result[] = parseURL($url); |
211 | 211 | } |