ReviewOS

also looking at this

meemalabs/laravel-text-to-speech

Apply fixes from StyleCI

#31
Merged luigel wants to merge analysis-Vr1RR6 into support-laravel-9
15 files +55 -58
src/Contracts/Converter.phpmodified+6-7
Changes to src/Contracts/Converter.php
@@ -7,9 +7,8 @@ interface Converter
77 /**
88 * Converts text to speech.
99 *
10 * @param string $text
11 * @param array|null $options
12 *
10 * @param string $text
11 * @param array|null $options
1312 * @return mixed
1413 */
1514 public function convert(string $text, array $options = null);
formatting only · 8 hidden lines
Changes to src/Contracts/Converter.php
@@ -17,7 +16,7 @@ interface Converter formatting only
1716 /**
1817 * Set where to store the converted file.
1918 *
20 * @param string $disk
19 * @param string $disk
2120 * @return $this
2221 */
2322 public function disk(string $disk);
formatting only · 8 hidden lines
Changes to src/Contracts/Converter.php
@@ -25,7 +24,7 @@ interface Converter formatting only
2524 /**
2625 * Set path to where to save the converted file.
2726 *
28 * @param string $path
27 * @param string $path
2928 * @return $this
3029 */
3130 public function saveTo(string $path);
formatting only · 8 hidden lines
Changes to src/Contracts/Converter.php
@@ -33,7 +32,7 @@ interface Converter formatting only
3332 /**
3433 * Sets the source where the text from.
3534 *
36 * @param string $source
35 * @param string $source
3736 * @return $this
3837 */
3938 public function source(string $source);
formatting only · 8 hidden lines
Changes to src/Contracts/Converter.php
@@ -41,7 +40,7 @@ interface Converter formatting only
4140 /**
4241 * Sets the language to be used.
4342 *
44 * @param string $language
43 * @param string $language
4544 * @return $this
4645 */
4746 public function language(string $language);
src/Contracts/Formatter.phpmodified+2-3
Changes to src/Contracts/Formatter.php
@@ -7,9 +7,8 @@ interface Formatter
77 /**
88 * Handles the filename of the audio.
99 *
10 * @param string $text The text source
11 * @param mixed $audio The result audio content.
12 *
10 * @param string $text The text source
11 * @param mixed $audio The result audio content.
1312 * @return string
1413 */
1514 public function handle($text, $audio = null): string;
src/Contracts/Source.phpmodifiedformatting only+1-1
Changes to src/Contracts/Source.php
@@ -7,7 +7,7 @@ interface Source
77 /**
88 * Handles in getting the text from source.
99 *
10 * @param string $data
10 * @param string $data
1111 * @return string
1212 */
1313 public function handle(string $data): string;
src/Converters/NullConverter.phpmodified+2-3
Changes to src/Converters/NullConverter.php
@@ -15,9 +15,8 @@ class NullConverter implements Converter
1515 /**
1616 * Converts the text to speech.
1717 *
18 * @param mixed $data
19 * @param array|null $options
20 *
18 * @param mixed $data
19 * @param array|null $options
2120 * @return string
2221 */
2322 public function convert($data, array $options = null)
src/Converters/PollyConverter.phpmodified+13-15
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -26,7 +26,7 @@ class PollyConverter implements Converter formatting only
2626 /**
2727 * Construct converter.
2828 *
29 * @param PollyClient $client
29 * @param PollyClient $client
3030 */
3131 public function __construct(PollyClient $client)
3232 {
Changes to src/Converters/PollyConverter.php
@@ -46,9 +46,8 @@ class PollyConverter implements Converter
4646 /**
4747 * Converts the text to speech.
4848 *
49 * @param string $data
50 * @param array|null $options
51 *
49 * @param string $data
50 * @param array|null $options
5251 * @return string|array
5352 */
5453 public function convert(string $data, array $options = null)
@@ -82,9 +81,8 @@ class PollyConverter implements Converter
8281 /**
8382 * Request to Amazon Polly to synthesize speech.
8483 *
85 * @param string|array $text
86 * @param array|null $options
87 *
84 * @param string|array $text
85 * @param array|null $options
8886 * @return array|\Aws\Result
8987 */
9088 protected function synthesizeSpeech($text, array $options = null)
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -137,7 +135,7 @@ class PollyConverter implements Converter formatting only
137135 /**
138136 * Checks the length of the text if more than 3000.
139137 *
140 * @param string $text
138 * @param string $text
141139 * @return bool
142140 */
143141 protected function isTextAboveLimit(string $text)
formatting only · 10 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -148,8 +146,8 @@ class PollyConverter implements Converter formatting only
148146 /**
149147 * Chunk the given text into array.
150148 *
151 * @param string $text
152 * @param int $size
149 * @param string $text
150 * @param int $size
153151 * @return array
154152 */
155153 protected function getChunkText(string $text, int $size = 2000)
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -160,7 +158,7 @@ class PollyConverter implements Converter formatting only
160158 /**
161159 * Get the text to speech voice ID.
162160 *
163 * @param array $options
161 * @param array $options
164162 * @return string
165163 */
166164 protected function voice($options)
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -195,7 +193,7 @@ class PollyConverter implements Converter formatting only
195193 /**
196194 * Get the audio format.
197195 *
198 * @param array $options
196 * @param array $options
199197 * @return string
200198 */
201199 protected function format($options)
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -212,7 +210,7 @@ class PollyConverter implements Converter formatting only
212210 /**
213211 * Get the engine.
214212 *
215 * @param array $options
213 * @param array $options
216214 * @return string
217215 */
218216 protected function engine($options)
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -235,7 +233,7 @@ class PollyConverter implements Converter formatting only
235233 /**
236234 * Get the content of the result from AWS Polly.
237235 *
238 * @param Result $result
236 * @param Result $result
239237 * @return mixed
240238 */
241239 protected function getResultContent($result)
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php
@@ -256,7 +254,7 @@ class PollyConverter implements Converter formatting only
256254 /**
257255 * Format the given json string into an array.
258256 *
259 * @param string $json
257 * @param string $json
260258 * @return array
261259 */
262260 protected function formatToArray($json)
src/Formatters/DefaultFilenameFormatter.phpmodified+2-3
Changes to src/Formatters/DefaultFilenameFormatter.php
@@ -9,9 +9,8 @@ class DefaultFilenameFormatter implements FormatterContract
99 /**
1010 * Handles the filename of the audio.
1111 *
12 * @param string $text The text source.
13 * @param mixed $audio The result audio content.
14 *
12 * @param string $text The text source.
13 * @param mixed $audio The result audio content.
1514 * @return string
1615 */
1716 public function handle($text, $audio = null): string
src/Sources/PathSource.phpmodifiedformatting only+1-1
Changes to src/Sources/PathSource.php
@@ -9,7 +9,7 @@ class PathSource implements SourceContract
99 /**
1010 * Handles in getting the text from source.
1111 *
12 * @param string $data
12 * @param string $data
1313 * @return string
1414 */
1515 public function handle(string $data): string
src/Sources/RecursiveDOMIterator.phpmodified+10-1
Changes to src/Sources/RecursiveDOMIterator.php
@@ -9,18 +9,20 @@ class RecursiveDOMIterator implements RecursiveIterator
99{
1010 /**
1111 * Current Position in DOMNodeList.
12 *
1213 * @var int
1314 */
1415 protected $_position;
1516
1617 /**
1718 * The DOMNodeList with all children to iterate over.
19 *
1820 * @var DOMNodeList
1921 */
2022 protected $_nodeList;
2123
2224 /**
23 * @param DOMNode $domNode
25 * @param DOMNode $domNode
2426 */
2527 public function __construct(DOMNode $domNode)
2628 {
@@ -30,6 +32,7 @@ class RecursiveDOMIterator implements RecursiveIterator
3032
3133 /**
3234 * Returns the current DOMNode.
35 *
3336 * @return DOMNode
3437 */
3538 public function current()
@@ -39,6 +42,7 @@ class RecursiveDOMIterator implements RecursiveIterator
3942
4043 /**
4144 * Returns an iterator for the current iterator entry.
45 *
4246 * @return RecursiveDOMIterator
4347 */
4448 public function getChildren()
@@ -48,6 +52,7 @@ class RecursiveDOMIterator implements RecursiveIterator
4852
4953 /**
5054 * Returns if an iterator can be created for the current entry.
55 *
5156 * @return bool
5257 */
5358 public function hasChildren()
@@ -57,6 +62,7 @@ class RecursiveDOMIterator implements RecursiveIterator
5762
5863 /**
5964 * Returns the current position.
65 *
6066 * @return int
6167 */
6268 public function key()
@@ -66,6 +72,7 @@ class RecursiveDOMIterator implements RecursiveIterator
6672
6773 /**
6874 * Moves the current position to the next element.
75 *
6976 * @return void
7077 */
7178 public function next()
@@ -75,6 +82,7 @@ class RecursiveDOMIterator implements RecursiveIterator
7582
7683 /**
7784 * Rewind the Iterator to the first element.
85 *
7886 * @return void
7987 */
8088 public function rewind()
@@ -84,6 +92,7 @@ class RecursiveDOMIterator implements RecursiveIterator
8492
8593 /**
8694 * Checks if current position is valid.
95 *
8796 * @return bool
8897 */
8998 public function valid()
src/Sources/TextSource.phpmodifiedformatting only+1-1
Changes to src/Sources/TextSource.php
@@ -9,7 +9,7 @@ class TextSource implements SourceContract
99 /**
1010 * Handles in getting the text from source.
1111 *
12 * @param string $data
12 * @param string $data
1313 * @return string
1414 */
1515 public function handle(string $data): string
src/Sources/WebsiteSource.phpmodifiedformatting only+2-2
Changes to src/Sources/WebsiteSource.php
@@ -12,7 +12,7 @@ class WebsiteSource implements SourceContract
1212 /**
1313 * Handles in getting the text from source.
1414 *
15 * @param string $data
15 * @param string $data
1616 * @return string
1717 */
1818 public function handle(string $data): string
@@ -45,7 +45,7 @@ class WebsiteSource implements SourceContract
4545 /**
4646 * Get text from the articles DOM Node List.
4747 *
48 * @param DOMNodeList $articles
48 * @param DOMNodeList $articles
4949 * @return string
5050 */
5151 protected function getTextFromArticle(DOMNodeList $articles): string
src/TextToSpeechManager.phpmodifiedformatting only+3-3
Changes to src/TextToSpeechManager.php
@@ -45,8 +45,8 @@ class TextToSpeechManager extends Manager
4545 /**
4646 * Sets the polly client.
4747 *
48 * @param array $config
49 * @param Credentials $credentials
48 * @param array $config
49 * @param Credentials $credentials
5050 * @return PollyClient
5151 */
5252 protected function setPollyClient(array $config, Credentials $credentials)
@@ -61,7 +61,7 @@ class TextToSpeechManager extends Manager
6161 /**
6262 * Get credentials of AWS.
6363 *
64 * @param array $credentials
64 * @param array $credentials
6565 * @return \Aws\Credentials\Credentials
6666 */
6767 protected function getCredentials(array $credentials)
src/Traits/HasLanguage.phpmodifiedformatting only+1-1
Changes to src/Traits/HasLanguage.php
@@ -12,7 +12,7 @@ trait HasLanguage
1212 /**
1313 * Sets the language to be used.
1414 *
15 * @param string $language
15 * @param string $language
1616 * @return $this
1717 */
1818 public function language(string $language)
src/Traits/HasSpeechMarks.phpmodifiedformatting only+1-1
Changes to src/Traits/HasSpeechMarks.php
@@ -12,7 +12,7 @@ trait HasSpeechMarks
1212 /**
1313 * Sets the speech mark types.
1414 *
15 * @param array $speechMarks
15 * @param array $speechMarks
1616 * @return $this
1717 */
1818 public function speechMarks(array $speechMarks)
src/Traits/Sourceable.phpmodified+2-3
formatting only · 8 hidden lines
Changes to src/Traits/Sourceable.php
@@ -16,7 +16,7 @@ trait Sourceable formatting only
1616 /**
1717 * Sets the source.
1818 *
19 * @param string $source
19 * @param string $source
2020 * @return $this
2121 */
2222 public function source(string $source)
Changes to src/Traits/Sourceable.php
@@ -29,8 +29,7 @@ trait Sourceable
2929 /**
3030 * Get text from source.
3131 *
32 * @param string $data
33 *
32 * @param string $data
3433 * @return string
3534 */
3635 protected function getTextFromSource(string $data): string
src/Traits/Storable.phpmodified+8-13
Changes to src/Traits/Storable.php
@@ -24,8 +24,7 @@ trait Storable
2424 /**
2525 * Set where to store the converted file.
2626 *
27 * @param string $disk
28 *
27 * @param string $disk
2928 * @return $this
3029 */
3130 public function disk(string $disk)
@@ -38,8 +37,7 @@ trait Storable
3837 /**
3938 * Set path to where to store the converted file.
4039 *
41 * @param string $path
42 *
40 * @param string $path
4341 * @return $this
4442 */
4543 public function saveTo(string $path)
@@ -52,9 +50,8 @@ trait Storable
5250 /**
5351 * Execute the store.
5452 *
55 * @param string $text
56 * @param mixed $resultContent
57 *
53 * @param string $text
54 * @param mixed $resultContent
5855 * @return string
5956 */
6057 protected function store($text, $resultContent)
@@ -71,9 +68,8 @@ trait Storable
7168 /**
7269 * Ensures the path not to be null if it is null it will set a default path.
7370 *
74 * @param string $text
75 * @param mixed $audio
76 *
71 * @param string $text
72 * @param mixed $audio
7773 * @return void
7874 */
7975 protected function ensurePathIsNotNull($text, $audio)
@@ -111,9 +107,8 @@ trait Storable
111107 /**
112108 * Get default filename returned in Filename Formatter.
113109 *
114 * @param string $text
115 * @param mixed $audio
116 *
110 * @param string $text
111 * @param mixed $audio
117112 * @return string
118113 */
119114 protected function getDefaultFilename($text, $audio)