src/Converters/PollyConverter.phpmodified+11-17Changes to src/Converters/PollyConverter.php | @@ -51,15 +51,13 @@ class PollyConverter implements Converter |
| 51 | 51 | { |
| 52 | 52 | $text = $this->getTextFromSource($data); |
| 53 | 53 | |
| 54 | | - if ($this->isTextAboveLimit($text)) |
| 55 | | - { |
| 54 | + if ($this->isTextAboveLimit($text)) { |
| 56 | 55 | $text = $this->getChunkText($text); |
| 57 | 56 | } |
| 58 | 57 | |
| 59 | 58 | $result = $this->synthesizeSpeech($text, $options); |
| 60 | 59 | |
| 61 | | - if ($result instanceof Result) |
| 62 | | - { |
| 60 | + if ($result instanceof Result) { |
| 63 | 61 | |
| 64 | 62 | return $this->store( |
| 65 | 63 | $this->getTextFromSource($data), |
formatting only · 7 hidden lines
Changes to src/Converters/PollyConverter.php | @@ -71,7 +69,6 @@ class PollyConverter implements Converter formatting only |
| 71 | 69 | $this->getTextFromSource($data), |
| 72 | 70 | $this->mergeOutputs($result) |
| 73 | 71 | ); |
| 74 | | - |
| 75 | 72 | } |
| 76 | 73 | |
| 77 | 74 | |
Changes to src/Converters/PollyConverter.php | @@ -83,20 +80,18 @@ class PollyConverter implements Converter |
| 83 | 80 | |
| 84 | 81 | protected function synthesizeSpeech($text, array $options = null) |
| 85 | 82 | { |
| 86 | | - if (is_string($text)) |
| 87 | | - { |
| 83 | + if (is_string($text)) { |
| 88 | 84 | return $this->client->synthesizeSpeech([ |
| 89 | 85 | 'VoiceId' => $this->voice($options), |
| 90 | 86 | 'OutputFormat' => $this->format($options), |
| 91 | 87 | 'TextType' => 'ssml', |
| 92 | | - 'Text' => '<speak>' . $text . '</speak>', |
| 88 | + 'Text' => '<speak>'.$text.'</speak>', |
| 93 | 89 | ]); |
| 94 | 90 | } |
| 95 | 91 | |
| 96 | 92 | $results = []; |
| 97 | 93 | |
| 98 | | - foreach ($text as $item) |
| 99 | | - { |
| 94 | + foreach ($text as $item) { |
| 100 | 95 | $result = $this->client->synthesizeSpeech([ |
| 101 | 96 | 'VoiceId' => $this->voice($options), |
| 102 | 97 | 'OutputFormat' => $this->format($options), |
| @@ -110,15 +105,14 @@ class PollyConverter implements Converter |
| 110 | 105 | } |
| 111 | 106 | |
| 112 | 107 | |
| 113 | | - |
| 108 | + |
| 114 | 109 | |
| 115 | 110 | |
| 116 | 111 | |
| 117 | 112 | protected function mergeOutputs(array $results) |
| 118 | 113 | { |
| 119 | 114 | $mergedResult = null; |
| 120 | | - foreach ($results as $result) |
| 121 | | - { |
| 115 | + foreach ($results as $result) { |
| 122 | 116 | $mergedResult .= $this->getResultContent($result); |
| 123 | 117 | } |
| 124 | 118 | |
| @@ -126,10 +120,10 @@ class PollyConverter implements Converter |
| 126 | 120 | } |
| 127 | 121 | |
| 128 | 122 | |
| 129 | | - |
| 123 | + |
| 130 | 124 | |
| 131 | 125 | |
| 132 | | - |
| 126 | + |
| 133 | 127 | |
| 134 | 128 | protected function isTextAboveLimit(string $text) |
| 135 | 129 | { |
| @@ -137,7 +131,7 @@ class PollyConverter implements Converter |
| 137 | 131 | } |
| 138 | 132 | |
| 139 | 133 | |
| 140 | | - |
| 134 | + |
| 141 | 135 | |
| 142 | 136 | |
| 143 | 137 | |
formatting only · 8 hidden lines
Changes to src/Converters/PollyConverter.php | @@ -145,7 +139,7 @@ class PollyConverter implements Converter formatting only |
| 145 | 139 | |
| 146 | 140 | protected function getChunkText(string $text, int $size = 2000) |
| 147 | 141 | { |
| 148 | | - return explode( "\n", wordwrap($text, $size)); |
| 142 | + return explode("\n", wordwrap($text, $size)); |
| 149 | 143 | } |
| 150 | 144 | |
| 151 | 145 | |
src/Sources/WebsiteSource.phpmodifiedformatting only+1-1Changes to src/Sources/WebsiteSource.php | @@ -64,7 +64,7 @@ class WebsiteSource implements SourceContract |
| 64 | 64 | ); |
| 65 | 65 | foreach ($dit as $node) { |
| 66 | 66 | if ($node->nodeName === 'p') { |
| 67 | | - $text .= $node->textContent . ' '; |
| 67 | + $text .= $node->textContent.' '; |
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | } |