title: Get user instead of Userinterface
body: <p>How to get User class instead of Userinterface when i do :</p>
  
  <p>$this->security->getUser()
  (Security is Symfony\Component\Security\Core\Security;)</p>
  
  <p>By Example (and its just an example :), i have this custom function :</p>
  
  <pre><code>public function getUser(User $user){
  }
  
  </code></pre>
  
  <p>and when i do that :</p>
  
  <pre><code>public function __construct(
          Security $security,
      ) {
          $this-&gt;security = $security;
      }
  
  getUser($this-&gt;security-&gt;getUser());
  </code></pre>
  
  <p>I have a warning :</p>
  
  <blockquote>
    <p>getUser expects App\Entity\User, Symfony\Component\Security\Core\User\UserInterface|null given.</p>
  </blockquote>