@@ -92,8 +92,7 @@ discard block |
||
| 92 | 92 | $dt = new \DateTime($node->getAttribute('content')); |
| 93 | 93 | break; |
| 94 | 94 | } |
| 95 | - } |
|
| 96 | - catch (\Exception $e) { |
|
| 95 | + } catch (\Exception $e) { |
|
| 97 | 96 | // Do nothing here in case the node has unrecognizable date information. |
| 98 | 97 | } |
| 99 | 98 | } |
@@ -113,8 +112,7 @@ discard block |
||
| 113 | 112 | $dt = new \DateTime($json->datePublished); |
| 114 | 113 | break; |
| 115 | 114 | } |
| 116 | - } |
|
| 117 | - catch (\Exception $e) { |
|
| 115 | + } catch (\Exception $e) { |
|
| 118 | 116 | // Do nothing here in case the node has unrecognizable date information. |
| 119 | 117 | } |
| 120 | 118 | } |
@@ -141,8 +139,7 @@ discard block |
||
| 141 | 139 | $dt = new \DateTime($node->getAttribute('content')); |
| 142 | 140 | break; |
| 143 | 141 | } |
| 144 | - } |
|
| 145 | - catch (\Exception $e) { |
|
| 142 | + } catch (\Exception $e) { |
|
| 146 | 143 | // Do nothing here in case the node has unrecognizable date information. |
| 147 | 144 | } |
| 148 | 145 | } |
@@ -174,8 +171,7 @@ discard block |
||
| 174 | 171 | if (is_null($dt) && isset($og_data['pubdate'])) { |
| 175 | 172 | $dt = new \DateTime($og_data['pubdate']); |
| 176 | 173 | } |
| 177 | - } |
|
| 178 | - catch (\Exception $e) { |
|
| 174 | + } catch (\Exception $e) { |
|
| 179 | 175 | // Do nothing here in case the node has unrecognizable date information. |
| 180 | 176 | } |
| 181 | 177 | |
@@ -207,8 +203,7 @@ discard block |
||
| 207 | 203 | $dt = new \DateTime($json->dateCreated); |
| 208 | 204 | break; |
| 209 | 205 | } |
| 210 | - } |
|
| 211 | - catch (\Exception $e) { |
|
| 206 | + } catch (\Exception $e) { |
|
| 212 | 207 | // Do nothing here in case the node has unrecognizable date information. |
| 213 | 208 | } |
| 214 | 209 | } |
@@ -227,8 +222,7 @@ discard block |
||
| 227 | 222 | $dt = new \DateTime($node->getAttribute('content')); |
| 228 | 223 | break; |
| 229 | 224 | } |
| 230 | - } |
|
| 231 | - catch (\Exception $e) { |
|
| 225 | + } catch (\Exception $e) { |
|
| 232 | 226 | // Do nothing here in case the node has unrecognizable date information. |
| 233 | 227 | } |
| 234 | 228 | } |
@@ -250,8 +244,7 @@ discard block |
||
| 250 | 244 | break; |
| 251 | 245 | } |
| 252 | 246 | } |
| 253 | - } |
|
| 254 | - catch (\Exception $e) { |
|
| 247 | + } catch (\Exception $e) { |
|
| 255 | 248 | // Do nothing here in case the node has unrecognizable date information. |
| 256 | 249 | } |
| 257 | 250 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | // Additionally retrieve type values based on provided og:type (http://ogp.me/#types) |
| 85 | 85 | if (isset($results['type'])) { |
| 86 | - $nodes = $this->article()->getDoc()->find('meta[property^="' . $results['type'] .':"]'); |
|
| 86 | + $nodes = $this->article()->getDoc()->find('meta[property^="'.$results['type'].':"]'); |
|
| 87 | 87 | |
| 88 | 88 | foreach ($nodes as $node) { |
| 89 | 89 | $property = explode(':', $node->attr('property')); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $srcHost = parse_url($src, PHP_URL_HOST); |
| 335 | 335 | $srcScheme = parse_url($src, PHP_URL_SCHEME); |
| 336 | 336 | |
| 337 | - return $match || preg_match('@' . $domain . '$@i', $srcHost) && in_array($srcScheme, ['http', 'https']); |
|
| 337 | + return $match || preg_match('@'.$domain.'$@i', $srcHost) && in_array($srcScheme, ['http', 'https']); |
|
| 338 | 338 | }); |
| 339 | 339 | |
| 340 | 340 | if ($match) { |
@@ -376,10 +376,10 @@ discard block |
||
| 376 | 376 | $stopWords = $this->config()->getStopWords()->getCurrentStopWords(); |
| 377 | 377 | |
| 378 | 378 | $text = $this->article()->getTitle(); |
| 379 | - $text .= ' ' . $this->article()->getMetaDescription(); |
|
| 379 | + $text .= ' '.$this->article()->getMetaDescription(); |
|
| 380 | 380 | |
| 381 | 381 | if ($this->article()->getTopNode()) { |
| 382 | - $text .= ' ' . $this->article()->getCleanedArticleText(); |
|
| 382 | + $text .= ' '.$this->article()->getCleanedArticleText(); |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | // Decode and split words by white-space |