Skip to content

Commit bf9d97e

Browse files
joshtrichardsCarlSchwan
authored andcommitted
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 07bac53 commit bf9d97e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/private/PreviewManager.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +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-
#[\Override]
111-
public function registerProvider(string $mimeTypeRegex, Closure $callable): void {
110+
private function registerProviderClosure(string $mimeTypeRegex, Closure $callable): void {
112111
if (!$this->enablePreviews) {
113112
return;
114113
}
@@ -300,7 +299,7 @@ protected function getEnabledDefaultProvider(): array {
300299
*/
301300
protected function registerCoreProvider(string $class, string $mimeType, array $options = []): void {
302301
if (in_array(trim($class, '\\'), $this->getEnabledDefaultProvider())) {
303-
$this->registerProvider($mimeType, function () use ($class, $options) {
302+
$this->registerProviderClosure($mimeType, function () use ($class, $options): IProviderV2 {
304303
return new $class($options);
305304
});
306305
}
@@ -426,7 +425,7 @@ private function registerBootstrapProviders(): void {
426425
}
427426
$this->loadedBootstrapProviders[$key] = null;
428427

429-
$this->registerProvider($provider->getMimeTypeRegex(), function () use ($provider): IProviderV2|false {
428+
$this->registerProviderClosure($provider->getMimeTypeRegex(), function () use ($provider): IProviderV2|false {
430429
try {
431430
return $this->container->get($provider->getService());
432431
} catch (NotFoundExceptionInterface) {

0 commit comments

Comments
 (0)