title: "Error [Semantical Error] The annotation "@Doctrine\ORM\Mapping\OnetoMany" in property" on Gitlab CI but not in local env or production
body: <p>I've written some tests on an symfony 4.4 application and I would like to run these tests on my gitlab CI but I get this error :</p>
  <blockquote>
  <p>Error [Semantical Error] The annotation
  &quot;@Doctrine\ORM\Mapping\OnetoMany&quot; in property
  App\Entity\Client::$logsRegions was never imported     . Did you
  maybe forget to add a &quot;use&quot; statement for this annotation?</p>
  </blockquote>
  <p>but I haven't this error neither in my local env nor in production env and I import <code>Doctrine\ORM\Mapping as ORM</code> in my entity</p>
  <p>Here my Client entity</p>
  <pre><code>&lt;?php
  
  namespace App\Entity;
  
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  use App\Entity\Region\AccessLogRegion;
  use App\Entity\Traits\ClientTrait;
  use Symfony\Component\Validator\Constraints as Assert;
  /**
   * Client
   *
   * @ORM\Table(name=&quot;client&quot;)
   * @ORM\Entity(repositoryClass=&quot;App\Repository\ClientRepository&quot;)
   * @ORM\HasLifecycleCallbacks
   */
  class Client
  {
      use ClientTrait;
      /**
       * @var int
       *
       * @ORM\Column(name=&quot;id&quot;, type=&quot;integer&quot;)
       * @ORM\Id
       * @ORM\GeneratedValue(strategy=&quot;AUTO&quot;)
       */
      private $id;
  
     //...
  
      /**
       * @ORM\OnetoMany(targetEntity=AccessLogRegion::class, mappedBy=&quot;client&quot;)
       */
      private $logsRegions;
  
      public function __construct()
      {
          $this-&gt;logsRegions = new ArrayCollection();
      }
  
      public function getLogsRegions()
      {
          return $this-&gt;logsRegions;
      }
  }
  </code></pre>
  <p>My .gitlab-ci.yml</p>
  <pre><code>image: jakzal/phpqa:php7.4
  
  before_script:
    - composer install
  
  cache:
    paths:
      - vendor/
  
  stages:
    - UnitTests
  
  phpunit:
    image: php:7.4-apache
    stage: UnitTests
    services:
      - name: mysql:5.7
        alias: mysql
    variables:
      MYSQL_ROOT_PASSWORD: project
      MYSQL_DATABASE: project_test
      MYSQL_USER: root
      MYSQL_PASSWORD: project
      DATABASE_URL: 'mysql://root:project@mysql:3306/project_test'
    before_script:
      - apt-get update &amp;&amp; apt-get install -y git libzip-dev
      - curl -sSk https://getcomposer.org/installer | php -- --disable-tls &amp;&amp; mv composer.phar /usr/local/bin/composer
      - docker-php-ext-install mysqli pdo pdo_mysql zip
      - php bin/console doctrine:database:drop --force --env=test
      - php bin/console doctrine:database:create --env=test
      - php bin/console doctrine:schema:update --env=test --force
    script:
      - php bin/phpunit
    allow_failure: false
  </code></pre>
  <p>Complete gitlab error log :</p>
  <blockquote>
  <p>$ php bin/console doctrine:database:drop --force --env=test Dropped
  database /tmp/test/test_db.sqlite for connection named default</p>
  <p>$ php bin/console doctrine:database:create --env=test
  Created database
  /tmp/test/test_db.sqlite for connection named default
  $ php
  bin/console doctrine:schema:update --env=test --force</p>
  <p>In AnnotationException.php line 39:
  [Semantical Error] The annotation &quot;@Doctrine\ORM\Mapping\OnetoMany&quot; in
  prop     erty App\Entity\Client::$logsRegions was never imported     .
  Did you maybe forget to add a &quot;use&quot; statement for this annotation?</p>
  <p>doctrine:schema:update [--em EM] [--complete] [--dump-sql]
  [-f|--force] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose]
  [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env
  ENV] [--no-debug] [--] </p>
  <p>Cleaning up file based variables</p>
  <p>ERROR: Job failed: exit code 1</p>
  </blockquote>
  <p>I don't understand why it doesn't work, any help is welcome :)</p>