title: Clear cache command gets an error error after installing api-platform.com
body: <p>I'm trying to install api-platform but I'm  having problems after launching my composer install:</p>
  <p>I follow the official docs for installation with:</p>
  <pre><code>composer req api
  </code></pre>
  <p>When I start the server or when I try to run <code>composer install</code> I get this error:</p>
  <pre><code>Executing script cache:clear [KO]
   [KO]
  Script cache:clear returned with error code 255
  </code></pre>
  <p>and then a warning:</p>
  <pre><code>[WARNING] Some commands could not be registered:                               
  !!                                                                                  
  !!  
  !!  In DoctrineOrmPropertyMetadataFactory.php line 31:
  !!                                                                                 
  !!    Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property  
  !!    \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D  
  !!    octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc  
  !!    trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co  
  !!    ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040                  
  !!                                                                                 
  !!  
  !!  In DoctrineOrmPropertyMetadataFactory.php line 31:
  !!                                                                                 
  !!    Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property  
  !!    \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D  
  !!    octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc  
  !!    trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co  
  !!    ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040                  
  !!                                                                                 
  !!                                                                                  
  !!   [WARNING] Some commands could not be registered:                               
  !!                                                                                  
  !!  
  !!  In DoctrineOrmPropertyMetadataFactory.php line 31:
  !!                                                                                 
  !!    Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property  
  !!    \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D  
  !!    octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc  
  !!    trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co  
  !!    ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040                  
  !!                                                                                 
  !!  
  !!  In DoctrineOrmPropertyMetadataFactory.php line 31:
  !!                                                                                 
  !!    Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property  
  !!    \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D  
  !!    octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc  
  !!    trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co  
  !!    ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040                  
  !!                                                                                 
  !!  
  !!   // Clearing the cache for the dev environment with debug                       
  !!   // true                                                                        
  !!  
  !!  
  !!  In DoctrineOrmPropertyMetadataFactory.php line 31:
  !!                                                                                 
  !!    Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property  
  !!    \DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of D  
  !!    octrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\Doc  
  !!    trineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/Co  
  !!    ntainerPA69O1T/App_KernelDevDebugContainer.php on line 1040                  
  !!                                                                                 
  !!  
  !!  cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] &lt;command&gt;
  !!  
  !!  2020-08-25T12:06:30+02:00 [critical] Uncaught Error: Argument 1 passed to ApiPlatform\Core\Bridge\Doctrine\Orm\Metadata\Property\DoctrineOrmPropertyMetadataFactory::__construct() must be an instance of Doctrine\Common\Persistence\ManagerRegistry, instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in /var/www/test-api-sf/var/cache/dev/ContainerPA69O1T/App_KernelDevDebugContainer.php on line 1040
  </code></pre>
  <p>Why am I getting this error, and what can I do to circumvent it?</p>