ReviewOS

also looking at this

meemalabs/laravel-text-to-speech

Apply fixes from StyleCI

#10
Merged luigel wants to merge analysis-gOLA4E into master
2 files +19 -25
src/Sources/WebsiteSource.phpmodified+8-14
Changes to src/Sources/WebsiteSource.php
@@ -19,8 +19,7 @@ class WebsiteSource implements SourceContract
1919 {
2020 $articles = $this->getDOMDocumentArticle($data);
2121
22 if ($articles === null)
23 {
22 if ($articles === null) {
2423 return '';
2524 }
2625
@@ -38,8 +37,7 @@ class WebsiteSource implements SourceContract
3837 @$dom->loadHTML(file_get_contents($url));
3938 $element = $dom->getElementsByTagName('article')->item(0);
4039
41 if ($element !== null)
42 {
40 if ($element !== null) {
4341 return $element->childNodes;
4442 }
4543 }
@@ -54,11 +52,9 @@ class WebsiteSource implements SourceContract
5452 {
5553 $text = '';
5654
57 for ($i = 0; $i < $articles->length; $i++)
58 {
55 for ($i = 0; $i < $articles->length; $i++) {
5956 // Check element if there is a childNodes
60 if ($articles->item($i)->childNodes === null)
61 {
57 if ($articles->item($i)->childNodes === null) {
6258 continue;
6359 }
6460
@@ -66,15 +62,13 @@ class WebsiteSource implements SourceContract
6662 new RecursiveDOMIterator($articles->item($i)),
6763 RecursiveIteratorIterator::SELF_FIRST
6864 );
69 foreach ($dit as $node)
70 {
71 if ($node->nodeName === 'p')
72 {
65 foreach ($dit as $node) {
66 if ($node->nodeName === 'p') {
7367 $text .= $node->textContent;
7468 }
7569 }
7670 }
77
71
7872 return $text;
7973 }
80}⧵
74}