Get current auth user_id

@return mixed|null
338769
public function getAuthUserId()
    {
        $user_id = null;
        $user = $this->getAuthUser();
        if ($user) {
            $user_id = $user->user_id;
        }
        return $user_id;
    }
422200
public function getUserId()
    {
        $id = $this->getAttribute('userId');
        if (null === $id && null !== $this->user) {
            $id = $this->userId = $this->user->id;
        }

        return $id;
    }
692728
public static function getUser($username = null)
	{
		if ( is_null( $username ) ) $username = self::getCurrentUsername();

		if ( self::userExists( $username ) ) {
			return self::$auth['users'][ $username ];
		}

		return null;
	}
1125972
private function getUserData()
    {
        $auth = $this->authFactory->newInstance();
        return null !== $auth->getUserData() ? $auth->getUserData() : false;
    }
932672
public static function auth($user_id)
    {
        $user = self::instanceUser($user_id);
        Session::set(self::getSessionKey(), array($user->user_name, $user->password));
        return $user;
    }
376753
public function getUserId()
    {
        $params = Yii::$app->request->queryParams;
        if (empty($params['access-token'])) return false;
        $uid = $this->userIdentity->findIdentityByAccessToken($params['access-token']);
        if (empty($uid->id)) return false;
        else return $uid->id;
    }
491911
protected function sessionUserId() {
		$userId = null;
		$request = $this->newRequest();

		if ($request->session()->started()) {
			$userId = $request->session()->read($this->_config['sessionUserIdKey']);
		} else {
			$this->log('The Session is not started. This typically means a User is not logged in. In this case there is no Session value for the currently active User and therefore we will set the `creator_id` and `modifier_id` to a null value. As a fallback, we are manually starting the session and reading the `$this->_config[sessionUserIdKey]` value, which is probably not correct.', 'debug');
			try {
				$request->session()->start();
				$userId = $request->session()->read($this->_config['sessionUserIdKey']);
			} catch (RuntimeException $e) {
			}
		}

		return $userId;
	}
464989
private function getSystemUserId()
    {
        try {
            if (class_exists($class = '\Cartalyst\Sentry\Facades\Laravel\Sentry')
                    || class_exists($class = '\Cartalyst\Sentinel\Laravel\Facades\Sentinel')) {
                return ($class::check()) ? $class::getUser()->id : null;
            } elseif (\Auth::check()) {
                return \Auth::user()->getAuthIdentifier();
            }
        } catch (\Exception $e) {
            return null;
        }

        return null;
    }
376481
protected function getActiveUser()
    {
        if (!Config::has('culpa.users.active_user')) {
            return Auth::check() ? Auth::user() : null;
        }

        $fn = Config::get('culpa.users.active_user');
        if (!is_callable($fn)) {
            throw new \Exception('culpa.users.active_user should be a closure');
        }

        return $fn();
    }
1180969
public function getUserId() {
    if (array_key_exists(self::USER_ATTR, $this->payload)) {
      return $this->payload[self::USER_ATTR];
    }
    throw new Exception("No user_id in token");
  }
381830
public static function getCurrentUsername()
	{
		if ( is_array( self::$api_session ) ) {
			$auth = self::$api_session;
		} else {
			$auth = self::sessionRead();
		}
		return ( isset( $auth['username'] ) ) ? $auth['username'] : null;
	}
830555
public function getUser()
    {
        if (null === $this->getTokenStorage()->getToken()) {
            return null;
        }

        return $this->getTokenStorage()->getToken()->getUser();
    }
172291
public function getUser()
    {
        if ($this->_user) return $this->_user;
        
	    try {
    	    $za = $this->getAuth();
            $id = $za->getIdentity();
            if (!$id) return FALSE;
        } catch (\Exception $e) {
            return FALSE;
        }
                
        if (isset($id['user_id'])) {
        
           if (!$this->_connected) return false;          
           $this->_user = User::getAuthorized($id);
           
        }
        
        return $this->_user;
    }
1284545
public function user()
    {
        // If we've already retrieved the user for the current request we can just
        // return it back immediately. We do not want to fetch the user data on
        // every call to this method because that would be tremendously slow.
        if (! is_null($this->user)) {
            return $this->user;
        }

        $user = null;

        // If a user ID was provided in the JWT, then
        // we should attempt to fetch their profile.
        if (! empty($this->id())) {
            $user = $this->provider->retrieveById($this->id());
        }

        return $this->user = $user;
    }
339147
private function getAuthenticatedUser()
    {
        $auth = $this->getServiceLocator()
                     ->get( 'Zend\Authentication\AuthenticationService' );

        if ( $auth->hasIdentity() )
        {
            return $auth->getIdentity();
        }

        return null;
    }
433162
public function user()
	{
		if ($this->loggedOut)
		{
			return null;
		}

		if (!is_null($this->user))
		{
			return $this->user;
		}

		return $this->user = wp_get_current_user();
	}
15864
public function getUserId()
    {
        if (
            \Yii::$app !== null
            && \Yii::$app->has('user', true)
            && \Yii::$app->getUser() !== null
        ) {
            $user = \Yii::$app->getUser()->getIdentity(false);
            if ($user !== null) {
                return $user->getId();
            }
        }
        return null;
    }