Skip to content

Instantly share code, notes, and snippets.

@ismail1432
Last active July 6, 2022 14:13
Show Gist options
  • Save ismail1432/ca33839c0d972dd1475912006f57309d to your computer and use it in GitHub Desktop.
Save ismail1432/ca33839c0d972dd1475912006f57309d to your computer and use it in GitHub Desktop.
// Kernel.php
<?php
namespace App;

use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
- use Symfony\Component\Mime\FileBinaryMimeTypeGuesser;

class Kernel extends BaseKernel implements CompilerPassInterface
{
    use MicroKernelTrait;

-    public function process(ContainerBuilder $container)
-    {
-        // We should get the mimetype from the FileBinaryMimeTypeGuesser first.
-        $container->register(FileBinaryMimeTypeGuesser::class, FileBinaryMimeTypeGuesser::class);
-        $container
-           ->getDefinition('mime_types')
-           ->addMethodCall('registerGuesser', [new Reference(FileBinaryMimeTypeGuesser::class)])
-       ;
-
-    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment