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

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

src/Sources/RecursiveDOMIterator.phpmodified+11-11
Changes to src/Sources/RecursiveDOMIterator.php
@@ -8,13 +8,13 @@ use RecursiveIterator;
88class RecursiveDOMIterator implements RecursiveIterator
99{
1010 /**
11 * Current Position in DOMNodeList
12 * @var Integer
11 * Current Position in DOMNodeList.
12 * @var int
1313 */
1414 protected $_position;
1515
1616 /**
17 * The DOMNodeList with all children to iterate over
17 * The DOMNodeList with all children to iterate over.
1818 * @var DOMNodeList
1919 */
2020 protected $_nodeList;
@@ -30,7 +30,7 @@ class RecursiveDOMIterator implements RecursiveIterator
3030 }
3131
3232 /**
33 * Returns the current DOMNode
33 * Returns the current DOMNode.
3434 * @return DOMNode
3535 */
3636 public function current()
@@ -39,7 +39,7 @@ class RecursiveDOMIterator implements RecursiveIterator
3939 }
4040
4141 /**
42 * Returns an iterator for the current iterator entry
42 * Returns an iterator for the current iterator entry.
4343 * @return RecursiveDOMIterator
4444 */
4545 public function getChildren()
@@ -49,7 +49,7 @@ class RecursiveDOMIterator implements RecursiveIterator
4949
5050 /**
5151 * Returns if an iterator can be created for the current entry.
52 * @return Boolean
52 * @return bool
5353 */
5454 public function hasChildren()
5555 {
@@ -57,8 +57,8 @@ class RecursiveDOMIterator implements RecursiveIterator
5757 }
5858
5959 /**
60 * Returns the current position
61 * @return Integer
60 * Returns the current position.
61 * @return int
6262 */
6363 public function key()
6464 {
@@ -75,7 +75,7 @@ class RecursiveDOMIterator implements RecursiveIterator
7575 }
7676
7777 /**
78 * Rewind the Iterator to the first element
78 * Rewind the Iterator to the first element.
7979 * @return void
8080 */
8181 public function rewind()
@@ -84,8 +84,8 @@ class RecursiveDOMIterator implements RecursiveIterator
8484 }
8585
8686 /**
87 * Checks if current position is valid
88 * @return Boolean
87 * Checks if current position is valid.
88 * @return bool
8989 */
9090 public function valid()
9191 {
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}