src/Sulu/Bundle/MediaBundle/Media/Manager/MediaManager.php
protected function getCurrentUser()
    {
        if (!$this->tokenStorage) {
            return;
        }

        if (!$this->tokenStorage->getToken()) {
            return;
        }

        $user = $this->tokenStorage->getToken()->getUser();

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

        return;
    }
protected function getCurrentUser()
    {
        if (!$this->tokenStorage) {
            return;
        }

        if (!$this->tokenStorage->getToken()) {
            return;
        }

        $user = $this->tokenStorage->getToken()->getUser();

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

        return;
    }
protected function getCurrentUser ( ) { if ( ! $ this -> tokenStorage ) { return ; } if ( ! $ this -> tokenStorage -> getToken ( ) ) { return ; } $ user = $ this -> tokenStorage -> getToken ( ) -> getUser ( ) ; if ( $ user instanceof UserInterface ) { return $ user ; } return ; }
Returns current user or null if no user is loggedin.

@return UserInterface|void
Returns current user or null if no user is loggedin .