1 | <?php |
||
8 | trait Storable |
||
9 | { |
||
10 | /** |
||
11 | * Determines where to save the converted file. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $disk; |
||
16 | |||
17 | /** |
||
18 | * Determines the path where to save the converted file. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $path; |
||
23 | |||
24 | /** |
||
25 | * Set where to store the converted file. |
||
26 | * |
||
27 | * @param string $disk |
||
28 | * |
||
29 | * @return $this |
||
30 | */ |
||
31 | public function disk(string $disk) |
||
37 | |||
38 | /** |
||
39 | * Set path to where to store the converted file. |
||
40 | * |
||
41 | * @param string $path |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | public function saveTo(string $path) |
||
51 | |||
52 | /** |
||
53 | * Execute the store. |
||
54 | * |
||
55 | * @param string $text |
||
56 | * @param mixed $resultContent |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | protected function store($text, $resultContent) |
||
70 | |||
71 | /** |
||
72 | * Ensures the path not to be null if it is null it will set a default path. |
||
73 | * |
||
74 | * @param string $text |
||
75 | * @param mixed $audio |
||
76 | * |
||
77 | * @return void |
||
78 | */ |
||
79 | protected function ensurePathIsNotNull($text, $audio) |
||
89 | |||
90 | /** |
||
91 | * Determine if filename includes file extension. |
||
92 | * |
||
93 | * @param string $filename |
||
94 | * @return bool |
||
95 | */ |
||
96 | protected function hasExtension($filename) |
||
100 | |||
101 | /** |
||
102 | * Get audio file extension. |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | protected function getExtension() |
||
110 | |||
111 | /** |
||
112 | * Get default filename returned in Filename Formatter. |
||
113 | * |
||
114 | * @param string $text |
||
115 | * @param mixed $audio |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | protected function getDefaultFilename($text, $audio) |
||
123 | |||
124 | /** |
||
125 | * Get the default path. |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | protected function getDefaultPath() |
||
133 | } |
||
134 |