@@ -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,8 @@ 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 {
303+ /** @var IProviderV2 $class */
304304 return new $ class ($ options );
305305 });
306306 }
@@ -425,7 +425,7 @@ private function registerBootstrapProviders(): void {
425425 }
426426 $ this ->loadedBootstrapProviders [$ key ] = null ;
427427
428- $ this ->registerProvider ($ provider ->getMimeTypeRegex (), function () use ($ provider ): IProviderV2 |false {
428+ $ this ->registerProviderClosure ($ provider ->getMimeTypeRegex (), function () use ($ provider ): IProviderV2 |false {
429429 try {
430430 return $ this ->container ->get ($ provider ->getService ());
431431 } catch (NotFoundExceptionInterface ) {
0 commit comments