Skip to content

Commit

Permalink
Keep a consistent format
Browse files Browse the repository at this point in the history
  • Loading branch information
kasparsd committed Jan 9, 2025
1 parent 03c2cab commit ff7cfb5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1896,10 +1896,8 @@ public static function user_two_factor_options( $user ) {
* @return bool True if the provider was enabled, false otherwise.
*/
public static function enable_provider_for_user( $user_id, $new_provider ) {
$available_providers = self::get_providers();

// Ensure the provider is even available.
if ( isset( $available_providers[ $new_provider ] ) ) {
if ( ! array_key_exists( $new_provider, self::get_providers() ) ) {
return false;
}

Expand Down Expand Up @@ -1930,7 +1928,7 @@ public static function enable_provider_for_user( $user_id, $new_provider ) {
*/
public static function disable_provider_for_user( $user_id, $provider_to_delete ) {
// Check if the provider is even enabled.
if ( ! in_array( $provider_to_delete, self::get_providers_classes(), true ) ) {
if ( ! array_key_exists( $provider_to_delete, self::get_providers() ) ) {
return false;
}

Expand Down

0 comments on commit ff7cfb5

Please sign in to comment.