Skip to content

Commit 254df7f

Browse files
FraGoTeAngelFQC
authored andcommitted
Fixing PHP-CS
1 parent ca8ff7a commit 254df7f

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

plugin/ai_helper/tool/learnpath.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@
7373
$audioControl = '';
7474
if ($isTextToSpeechEnabled && !empty($lpItemContent)) {
7575
$filePath = $text2speechPlugin->convert(strip_tags($lpItemContent));
76-
$audioControl = '<audio controls>' .
77-
'<source src="' . $filePath . '" type="audio/ogg">' .
78-
'Your browser does not support the audio element.' .
76+
$audioControl = '<audio controls>'.
77+
'<source src="'.$filePath.'" type="audio/ogg">'.
78+
'Your browser does not support the audio element.'.
7979
'</audio>';
8080
}
8181

8282
if (false !== stripos($lpItemContent, '</head>')) {
83-
$lpItemContent = preg_replace("|</head>|i", "\r\n$style\r\n\\0", $audioControl . $lpItemContent);
83+
$lpItemContent = preg_replace("|</head>|i", "\r\n$style\r\n\\0", $audioControl.$lpItemContent);
8484
} else {
85-
$lpItemContent = '<html><head><title>'.trim($title).'</title>'.$style.'</head><body>'. $audioControl . $lpItemContent.'</body></html>';
85+
$lpItemContent = '<html><head><title>'.trim($title).'</title>'.$style.'</head><body>'.$audioControl.$lpItemContent.'</body></html>';
8686
}
8787
$lpItems[$position]['content'] = $lpItemContent;
8888
$position++;

plugin/text2speech/Text2SpeechPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class Text2SpeechPlugin extends Plugin
1010
{
1111
public const MOZILLATTS_API = 'mozillatts';
12-
public const PATH_TO_SAVE_FILES = __DIR__ . '/files/';
12+
public const PATH_TO_SAVE_FILES = __DIR__.'/files/';
1313

1414
protected function __construct()
1515
{
@@ -55,7 +55,7 @@ public function convert(string $text)
5555
$path = '/plugin/text2speech/files/';
5656
switch ($this->get('api_name')) {
5757
case self::MOZILLATTS_API:
58-
require_once __DIR__ . '/src/mozillatts/MozillaTTS.php';
58+
require_once __DIR__.'/src/mozillatts/MozillaTTS.php';
5959

6060
$mozillaTTS = new MozillaTTS($this->get('url'), $this->get('api_key'), self::PATH_TO_SAVE_FILES);
6161
$path .= $mozillaTTS->convert($text);

plugin/text2speech/src/IProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
interface IProvider
44
{
55
public function __construct(string $url, string $key, string $filePath);
6-
public function convert(string $text) : string;
6+
public function convert(string $text): string;
77
}

plugin/text2speech/src/mozillatts/MozillaTTS.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once __DIR__ . '/../IProvider.php';
3+
require_once __DIR__.'/../IProvider.php';
44

55
class MozillaTTS implements IProvider
66
{
@@ -15,18 +15,18 @@ public function __construct(string $url, string $apiKey, string $filePath)
1515
$this->filePath = $filePath;
1616
}
1717

18-
public function convert(string $text) : string
18+
public function convert(string $text): string
1919
{
2020
return $this->request($text);
2121
}
2222

23-
private function request(string $data) : string
23+
private function request(string $data): string
2424
{
25-
$filename = uniqid() . '.wav';
26-
$filePath = $this->filePath . $filename;
25+
$filename = uniqid().'.wav';
26+
$filePath = $this->filePath.$filename;
2727
file_put_contents($filePath, file_get_contents(
28-
$this->url . '?api_key=' . urlencode($this->apiKey) .
29-
'&text=' . str_replace('%0A','+',urlencode($data))
28+
$this->url.'?api_key='.urlencode($this->apiKey).
29+
'&text='.str_replace('%0A','+',urlencode($data))
3030
));
3131

3232
return $filename;

0 commit comments

Comments
 (0)