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