private function getCustomerFromToken()
    {
        if (!($this->tokenStorage instanceof TokenStorageInterface)) {
            return null;
        }

        $token = $this->tokenStorage->getToken();
        if (!($token instanceof TokenInterface)) {
            return null;
        }

        $customer = $token->getUser();
        if (!($customer instanceof CustomerInterface)) {
            return null;
        }

        return $customer;
    }
private function getCustomerFromToken()
    {
        if (!($this->tokenStorage instanceof TokenStorageInterface)) {
            return null;
        }

        $token = $this->tokenStorage->getToken();
        if (!($token instanceof TokenInterface)) {
            return null;
        }

        $customer = $token->getUser();
        if (!($customer instanceof CustomerInterface)) {
            return null;
        }

        return $customer;
    }
private function getCustomerFromToken ( ) { if ( ! ( $ this -> tokenStorage instanceof TokenStorageInterface ) ) { return null ; } $ token = $ this -> tokenStorage -> getToken ( ) ; if ( ! ( $ token instanceof TokenInterface ) ) { return null ; } $ customer = $ token -> getUser ( ) ; if ( ! ( $ customer instanceof CustomerInterface ) ) { return null ; } return $ customer ; }
Return the current user from security context.

@return CustomerInterface Current customer in token
Return the current user from security context .