diff --git a/core/lib/Drupal/Core/ProxyClass/File/MimeType/ExtensionMimeTypeGuesser.php b/core/lib/Drupal/Core/ProxyClass/File/MimeType/ExtensionMimeTypeGuesser.php index a2eda15..b5f6f50 100644 --- a/core/lib/Drupal/Core/ProxyClass/File/MimeType/ExtensionMimeTypeGuesser.php +++ b/core/lib/Drupal/Core/ProxyClass/File/MimeType/ExtensionMimeTypeGuesser.php @@ -79,14 +79,6 @@ public function guess($path) return $this->lazyLoadItself()->guess($path); } - /** - * {@inheritdoc} - */ - public function setMapping(array $mapping = NULL) - { - return $this->lazyLoadItself()->setMapping($mapping); - } - } } diff --git a/core/lib/Drupal/Core/ProxyClass/File/MimeType/MimeTypeMapper.php b/core/lib/Drupal/Core/ProxyClass/File/MimeType/MimeTypeMapper.php new file mode 100644 index 0000000..519cd95 --- /dev/null +++ b/core/lib/Drupal/Core/ProxyClass/File/MimeType/MimeTypeMapper.php @@ -0,0 +1,132 @@ +container = $container; + $this->drupalProxyOriginalServiceId = $drupal_proxy_original_service_id; + } + + /** + * Lazy loads the real service from the container. + * + * @return object + * Returns the constructed real service. + */ + protected function lazyLoadItself() + { + if (!isset($this->service)) { + $this->service = $this->container->get($this->drupalProxyOriginalServiceId); + } + + return $this->service; + } + + /** + * {@inheritdoc} + */ + public function alterMapping(\Drupal\Core\Extension\ModuleHandlerInterface $module_handler) + { + return $this->lazyLoadItself()->alterMapping($module_handler); + } + + /** + * {@inheritdoc} + */ + public function addMapping($mimetype, $extension) + { + return $this->lazyLoadItself()->addMapping($mimetype, $extension); + } + + /** + * {@inheritdoc} + */ + public function removeMapping($extension) + { + return $this->lazyLoadItself()->removeMapping($extension); + } + + /** + * {@inheritdoc} + */ + public function removeMimeType($mimetype) + { + return $this->lazyLoadItself()->removeMimeType($mimetype); + } + + /** + * {@inheritdoc} + */ + public function getMimeTypes() + { + return $this->lazyLoadItself()->getMimeTypes(); + } + + /** + * {@inheritdoc} + */ + public function getMimeTypeForExtension($extension) + { + return $this->lazyLoadItself()->getMimeTypeForExtension($extension); + } + + /** + * {@inheritdoc} + */ + public function getExtensionsForMimeType($mimetype) + { + return $this->lazyLoadItself()->getExtensionsForMimeType($mimetype); + } + + } + +}