also looking at this
meemalabs/laravel-text-to-speech
Support laravel 9
#32
17 files
+83
-61
| @@ -24,8 +24,7 @@ trait Storable | ||
| 24 | 24 | /** |
| 25 | 25 | * Set where to store the converted file. |
| 26 | 26 | * |
| 27 | * @param string $disk | |
| 28 | * | |
| 27 | * @param string $disk | |
| 29 | 28 | * @return $this |
| 30 | 29 | */ |
| 31 | 30 | public function disk(string $disk) |
| @@ -38,8 +37,7 @@ trait Storable | ||
| 38 | 37 | /** |
| 39 | 38 | * Set path to where to store the converted file. |
| 40 | 39 | * |
| 41 | * @param string $path | |
| 42 | * | |
| 40 | * @param string $path | |
| 43 | 41 | * @return $this |
| 44 | 42 | */ |
| 45 | 43 | public function saveTo(string $path) |
| @@ -52,9 +50,8 @@ trait Storable | ||
| 52 | 50 | /** |
| 53 | 51 | * Execute the store. |
| 54 | 52 | * |
| 55 | * @param string $text | |
| 56 | * @param mixed $resultContent | |
| 57 | * | |
| 53 | * @param string $text | |
| 54 | * @param mixed $resultContent | |
| 58 | 55 | * @return string |
| 59 | 56 | */ |
| 60 | 57 | protected function store($text, $resultContent) |
| @@ -63,7 +60,7 @@ trait Storable | ||
| 63 | 60 | |
| 64 | 61 | $storage = Storage::disk($this->disk ?: config('tts.disk')); |
| 65 | 62 | |
| 66 | $storage->put($this->path, $resultContent); | |
| 63 | $storage->put($this->path, $resultContent ?? ''); | |
| 67 | 64 | |
| 68 | 65 | return $this->path; |
| 69 | 66 | } |
| @@ -71,9 +68,8 @@ trait Storable | ||
| 71 | 68 | /** |
| 72 | 69 | * Ensures the path not to be null if it is null it will set a default path. |
| 73 | 70 | * |
| 74 | * @param string $text | |
| 75 | * @param mixed $audio | |
| 76 | * | |
| 71 | * @param string $text | |
| 72 | * @param mixed $audio | |
| 77 | 73 | * @return void |
| 78 | 74 | */ |
| 79 | 75 | protected function ensurePathIsNotNull($text, $audio) |
| @@ -111,9 +107,8 @@ trait Storable | ||
| 111 | 107 | /** |
| 112 | 108 | * Get default filename returned in Filename Formatter. |
| 113 | 109 | * |
| 114 | * @param string $text | |
| 115 | * @param mixed $audio | |
| 116 | * | |
| 110 | * @param string $text | |
| 111 | * @param mixed $audio | |
| 117 | 112 | * @return string |
| 118 | 113 | */ |
| 119 | 114 | protected function getDefaultFilename($text, $audio) |