Please do:
```php
if ($this->securityContext->isGranted('IS_AUTHENTICATED_REMEMBERED') {
    return $this->securityContext->getToken()->getUser();
}

return null;