Instagram\Instagram::getUserInfo PHP Method

getUserInfo() public method

Get User Info
public getUserInfo ( string | User $userId ) : InfoUserResponse
$userId string | Instagram\API\Response\Model\User User or User Id to get Info of
return Instagram\API\Response\InfoUserResponse
    public function getUserInfo($userId)
    {
        if (!$this->isLoggedIn()) {
            throw new InstagramException("You must be logged in to call getUserInfo().");
        }
        if ($userId instanceof User) {
            $userId = $userId->getPk();
        }
        $request = new InfoUserRequest($this, $userId);
        $response = $request->execute();
        if (!$response->isOk()) {
            throw new InstagramException(sprintf("Failed to getUserInfo: [%s] %s", $response->getStatus(), $response->getMessage()));
        }
        return $response;
    }