@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | |
128 | 128 | public function listCreators(): array { |
129 | 129 | $types = $this->getTypes(); |
130 | - usort($types, function (TemplateFileCreator $a, TemplateFileCreator $b) { |
|
130 | + usort($types, function(TemplateFileCreator $a, TemplateFileCreator $b) { |
|
131 | 131 | return $a->getOrder() - $b->getOrder(); |
132 | 132 | }); |
133 | 133 | return $types; |
134 | 134 | } |
135 | 135 | |
136 | 136 | public function listTemplates(): array { |
137 | - return array_map(function (TemplateFileCreator $entry) { |
|
137 | + return array_map(function(TemplateFileCreator $entry) { |
|
138 | 138 | return array_merge($entry->jsonSerialize(), [ |
139 | 139 | 'templates' => $this->getTemplateFiles($entry) |
140 | 140 | ]); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $template = $userFolder->get($templateId); |
166 | 166 | $template->copy($targetFile->getPath()); |
167 | 167 | } else { |
168 | - $matchingProvider = array_filter($this->getRegisteredProviders(), function (ICustomTemplateProvider $provider) use ($templateType) { |
|
168 | + $matchingProvider = array_filter($this->getRegisteredProviders(), function(ICustomTemplateProvider $provider) use ($templateType) { |
|
169 | 169 | return $templateType === get_class($provider); |
170 | 170 | }); |
171 | 171 | $provider = array_shift($matchingProvider); |
@@ -266,8 +266,8 @@ discard block |
||
266 | 266 | $this->userId = $userId; |
267 | 267 | } |
268 | 268 | |
269 | - $defaultSkeletonDirectory = \OC::$SERVERROOT . '/core/skeleton'; |
|
270 | - $defaultTemplateDirectory = \OC::$SERVERROOT . '/core/skeleton/Templates'; |
|
269 | + $defaultSkeletonDirectory = \OC::$SERVERROOT.'/core/skeleton'; |
|
270 | + $defaultTemplateDirectory = \OC::$SERVERROOT.'/core/skeleton/Templates'; |
|
271 | 271 | $skeletonPath = $this->config->getSystemValue('skeletondirectory', $defaultSkeletonDirectory); |
272 | 272 | $skeletonTemplatePath = $this->config->getSystemValue('templatedirectory', $defaultTemplateDirectory); |
273 | 273 | $isDefaultSkeleton = $skeletonPath === $defaultSkeletonDirectory; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | try { |
278 | 278 | $l10n = $this->l10nFactory->get('lib', $userLang); |
279 | 279 | $userFolder = $this->rootFolder->getUserFolder($this->userId); |
280 | - $userTemplatePath = $path ?? $this->config->getAppValue('core', 'defaultTemplateDirectory', $l10n->t('Templates')) . '/'; |
|
280 | + $userTemplatePath = $path ?? $this->config->getAppValue('core', 'defaultTemplateDirectory', $l10n->t('Templates')).'/'; |
|
281 | 281 | |
282 | 282 | // Initial user setup without a provided path |
283 | 283 | if ($path === null) { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | if (!$userFolder->nodeExists('Templates')) { |
287 | 287 | return ''; |
288 | 288 | } |
289 | - $newPath = Filesystem::normalizePath($userFolder->getPath() . '/' . $userTemplatePath); |
|
289 | + $newPath = Filesystem::normalizePath($userFolder->getPath().'/'.$userTemplatePath); |
|
290 | 290 | if ($newPath !== $userFolder->get('Templates')->getPath()) { |
291 | 291 | $userFolder->get('Templates')->move($newPath); |
292 | 292 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | } |
326 | 326 | |
327 | 327 | if ($path !== null && $isDefaultSkeleton && $isDefaultTemplates && $folderIsEmpty) { |
328 | - $localizedSkeletonPath = $this->getLocalizedTemplatePath($skeletonPath . '/Templates', $userLang); |
|
328 | + $localizedSkeletonPath = $this->getLocalizedTemplatePath($skeletonPath.'/Templates', $userLang); |
|
329 | 329 | if (!empty($localizedSkeletonPath) && file_exists($localizedSkeletonPath)) { |
330 | 330 | \OC_Util::copyr($localizedSkeletonPath, $folder); |
331 | 331 | $userFolder->getStorage()->getScanner()->scan($folder->getInternalPath(), Scanner::SCAN_RECURSIVE); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $this->setTemplatePath($path ?? ''); |
338 | 338 | return $this->getTemplatePath(); |
339 | 339 | } catch (\Throwable $e) { |
340 | - $this->logger->error('Failed to initialize templates directory to user language ' . $userLang . ' for ' . $userId, ['app' => 'files_templates', 'exception' => $e]); |
|
340 | + $this->logger->error('Failed to initialize templates directory to user language '.$userLang.' for '.$userId, ['app' => 'files_templates', 'exception' => $e]); |
|
341 | 341 | } |
342 | 342 | $this->setTemplatePath(''); |
343 | 343 | return $this->getTemplatePath(); |