@@ -38,8 +38,8 @@ |
||
38 | 38 | class AppService extends AbstractService |
39 | 39 | { |
40 | 40 | /** |
41 | - * @var array |
|
42 | - */ |
|
41 | + * @var array |
|
42 | + */ |
|
43 | 43 | protected static $supportedMimeTypes = []; |
44 | 44 | |
45 | 45 | /** |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function getSupportedMimeTypes() |
205 | 205 | { |
206 | - if(is_array(self::$supportedMimeTypes) && count(self::$supportedMimeTypes) > 0) { |
|
206 | + if (is_array(self::$supportedMimeTypes) && count(self::$supportedMimeTypes) > 0) { |
|
207 | 207 | return self::$supportedMimeTypes; |
208 | 208 | } |
209 | 209 | |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | preg_match_all('/^[\s]*alias:[\s]*.*/im', $mimeTypeOutput, $aliasTypes); |
226 | 226 | |
227 | 227 | $supportedTypes = $coreTypes[0]; |
228 | - foreach($aliasTypes[0] as $aliasType) { |
|
229 | - $supportedTypes[] = trim(str_replace('alias:','', $aliasType)); |
|
228 | + foreach ($aliasTypes[0] as $aliasType) { |
|
229 | + $supportedTypes[] = trim(str_replace('alias:', '', $aliasType)); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | $supportedTypes = array_filter($supportedTypes); |
@@ -111,7 +111,7 @@ |
||
111 | 111 | protected function getExtractedMetaDataFromTikaService($file) |
112 | 112 | { |
113 | 113 | $tikaService = $this->getExtractor(); |
114 | - $result= $tikaService->extractMetaData($file); |
|
114 | + $result = $tikaService->extractMetaData($file); |
|
115 | 115 | |
116 | 116 | return $result; |
117 | 117 | } |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider; |
5 | 5 | use TYPO3\CMS\Core\Resource\File; |
6 | 6 | |
7 | -class Preview extends AbstractProvider{ |
|
7 | +class Preview extends AbstractProvider { |
|
8 | 8 | |
9 | 9 | protected $itemsConfiguration = [ |
10 | 10 | 'tika_preview' => [ |
@@ -83,7 +83,7 @@ |
||
83 | 83 | public function extractText(FileInterface $file) |
84 | 84 | { |
85 | 85 | $localTempFilePath = $file->getForLocalProcessing(false); |
86 | - /** @var Query $query */ |
|
86 | + /** @var Query $query */ |
|
87 | 87 | $query = GeneralUtility::makeInstance(Query::class); |
88 | 88 | $query->setFile($localTempFilePath); |
89 | 89 | $query->setExtractOnly(true); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | // EM might define a different connection than already in use by |
56 | 56 | // Index Queue |
57 | 57 | /** @var ConnectionManager $connectionManager */ |
58 | - $connectionManager = GeneralUtility::makeInstance(ConnectionManager::class); |
|
58 | + $connectionManager = GeneralUtility::makeInstance(ConnectionManager::class); |
|
59 | 59 | |
60 | 60 | $readNode = [ |
61 | 61 | 'host' => $this->configuration['solrHost'], |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $cleanedData = []; |
181 | 181 | |
182 | 182 | foreach ($metaDataResponse as $dataName => $dataArray) { |
183 | - if(!($dataName % 2) == 0) { |
|
183 | + if (!($dataName % 2) == 0) { |
|
184 | 184 | continue; |
185 | 185 | } |
186 | 186 | $fieldName = $dataArray; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | { |
214 | 214 | $mapping = [ |
215 | 215 | 'application/epub+zip' => ['epub'], |
216 | - 'application/gzip' => ['gz','tgz'], |
|
216 | + 'application/gzip' => ['gz', 'tgz'], |
|
217 | 217 | 'application/msword' => ['doc'], |
218 | 218 | 'application/pdf' => ['pdf'], |
219 | 219 | 'application/rtf' => ['rtf'], |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | 'application/zip' => ['zip'], |
229 | 229 | 'application/x-midi' => ['mid'], |
230 | 230 | 'application/xml' => ['xml'], |
231 | - 'audio/aiff' => ['aif','aiff'], |
|
231 | + 'audio/aiff' => ['aif', 'aiff'], |
|
232 | 232 | 'audio/basic' => ['au'], |
233 | 233 | 'audio/midi' => ['mid'], |
234 | 234 | 'audio/mpeg3' => ['mp3'], |
@@ -238,11 +238,11 @@ discard block |
||
238 | 238 | 'audio/x-wav' => ['wav'], |
239 | 239 | 'image/bmp' => ['bmp'], |
240 | 240 | 'image/gif' => ['gif'], |
241 | - 'image/jpeg' => ['jpg','jpeg'], |
|
241 | + 'image/jpeg' => ['jpg', 'jpeg'], |
|
242 | 242 | 'image/png' => ['png'], |
243 | 243 | 'image/svg+xml' => ['svg'], |
244 | - 'image/tiff' => ['tif','tiff'], |
|
245 | - 'text/html' => ['html','htm'], |
|
244 | + 'image/tiff' => ['tif', 'tiff'], |
|
245 | + 'text/html' => ['html', 'htm'], |
|
246 | 246 | 'text/plain' => ['txt'], |
247 | 247 | 'text/xml' => ['xml'], |
248 | 248 | 'video/mpeg' => ['mp3'], |
@@ -353,7 +353,7 @@ |
||
353 | 353 | { |
354 | 354 | $headers = [$this->getUserAgent(), 'Content-Type: application/octet-stream', 'Accept: application/json', 'Connection: close']; |
355 | 355 | |
356 | - $context = stream_context_create(['http' => ['protocol_version' => 1.1, 'method' => 'GET', 'header' => implode(CRLF, $headers),]]); |
|
356 | + $context = stream_context_create(['http' => ['protocol_version' => 1.1, 'method' => 'GET', 'header' => implode(CRLF, $headers), ]]); |
|
357 | 357 | |
358 | 358 | $response = $this->queryTika('/mime-types', $context); |
359 | 359 | return $response; |