private function findIdentity($account) { switch ($this->judgeAccountType($account)) { case static::ACCOUNT_TYPE_INTEGER: return User::findIdentity($account); case static::ACCOUNT_TYPE_EMAIL: return User::findIdentityByEmail($account); default: throw new \yii\base\NotSupportedException('Not recognized account type.'); } }