Skip to content

Commit 86b471d

Browse files
committed
chore(previews): registerProvider->registerProviderClosure in PreviewManager
No longer part of the public interface. Just an internal utility function. Apps/etc register in other ways and still end up here appropriately. Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent 43427a4 commit 86b471d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/private/PreviewManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function __construct(
107107
* @param string $mimeTypeRegex Regex with the mime types that are supported by this provider
108108
* @param ProviderClosure $callable
109109
*/
110-
public function registerProvider(string $mimeTypeRegex, Closure $callable): void {
110+
private function registerProviderClosure(string $mimeTypeRegex, Closure $callable): void {
111111
if (!$this->enablePreviews) {
112112
return;
113113
}
@@ -293,7 +293,7 @@ protected function getEnabledDefaultProvider(): array {
293293
*/
294294
protected function registerCoreProvider(string $class, string $mimeType, array $options = []): void {
295295
if (in_array(trim($class, '\\'), $this->getEnabledDefaultProvider())) {
296-
$this->registerProvider($mimeType, function () use ($class, $options) {
296+
$this->registerProviderClosure($mimeType, function () use ($class, $options): IProviderV2 {
297297
return new $class($options);
298298
});
299299
}
@@ -419,7 +419,7 @@ private function registerBootstrapProviders(): void {
419419
}
420420
$this->loadedBootstrapProviders[$key] = null;
421421

422-
$this->registerProvider($provider->getMimeTypeRegex(), function () use ($provider): IProviderV2|false {
422+
$this->registerProviderClosure($provider->getMimeTypeRegex(), function () use ($provider): IProviderV2|false {
423423
try {
424424
return $this->container->get($provider->getService());
425425
} catch (NotFoundExceptionInterface) {

0 commit comments

Comments
 (0)