src/Sulu/Bundle/MediaBundle/Collection/Manager/CollectionManager.php
protected function getCurrentUser()
    {
        if ($this->tokenStorage && ($token = $this->tokenStorage->getToken())) {
            $user = $token->getUser();

            if ($user instanceof UserInterface) {
                return $user;
            }
        }

        return;
    }
protected function getCurrentUser()
    {
        if ($this->tokenStorage && ($token = $this->tokenStorage->getToken())) {
            $user = $token->getUser();

            if ($user instanceof UserInterface) {
                return $user;
            }
        }

        return;
    }
protected function getCurrentUser ( ) { if ( $ this -> tokenStorage && ( $ token = $ this -> tokenStorage -> getToken ( ) ) ) { $ user = $ token -> getUser ( ) ; if ( $ user instanceof UserInterface ) { return $ user ; } } return ; }
Returns the current user from the token storage.

@return UserInterface|null
Returns the current user from the token storage .