original_string: public static function hasUser()
      {
  
          if (!(Yii::$app instanceof Application)) {
              return false;
          }
          if (!Yii::$app->db->getTableSchema(User::tableName())) {
              return false;
          }
          try {
              $identityClass = Yii::$app->user->identityClass;
          } catch (\Exception $e) {
              $identityClass = false;
          }
  
          if (!$identityClass) {
              return false;
          }
  
          return !Yii::$app->user->isGuest;
      }
code: public static function hasUser()
      {
  
          if (!(Yii::$app instanceof Application)) {
              return false;
          }
          if (!Yii::$app->db->getTableSchema(User::tableName())) {
              return false;
          }
          try {
              $identityClass = Yii::$app->user->identityClass;
          } catch (\Exception $e) {
              $identityClass = false;
          }
  
          if (!$identityClass) {
              return false;
          }
  
          return !Yii::$app->user->isGuest;
      }
code_tokens: public static function hasUser ( ) { if ( ! ( Yii :: $ app instanceof Application ) ) { return false ; } if ( ! Yii :: $ app -> db -> getTableSchema ( User :: tableName ( ) ) ) { return false ; } try { $ identityClass = Yii :: $ app -> user -> identityClass ; } catch ( \ Exception $ e ) { $ identityClass = false ; } if ( ! $ identityClass ) { return false ; } return ! Yii :: $ app -> user -> isGuest ; }
docstring: We just check whether module is installed and user is logged in.
  @return bool
docstring_tokens: We just check whether module is installed and user is logged in .