Skip to content

Commit

Permalink
Add @phan-suppress comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nateweller committed Jul 17, 2024
1 parent 720d334 commit 4f0663f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions projects/packages/waf/src/class-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,16 @@ public static function update_option_waf_ip_lists_enabled( $old_value, $value )
* @param mixed $value The new value of the option.
*/
public static function update_option_waf_ip_allow_list_enabled( $old_value, $value ) {
$block_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME, false );
$block_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_BLOCK_LIST_ENABLED_OPTION_NAME, false );
// @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility.
$legacy_option_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false );

if ( $value && ! $legacy_option_enabled ) {
// @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility.
update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, true );
}
if ( ! $value && ! $block_list_enabled ) {
// @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility.
update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false );
}
}
Expand All @@ -366,12 +369,15 @@ public static function update_option_waf_ip_allow_list_enabled( $old_value, $val
* @param mixed $value The new value of the option.
*/
public static function update_option_waf_ip_block_list_enabled( $old_value, $value ) {
$allow_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, false );
$allow_list_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_ALLOW_LIST_ENABLED_OPTION_NAME, false );
// @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility.
$legacy_option_enabled = Jetpack_Options::get_raw_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false );
if ( $value && ! $legacy_option_enabled ) {
// @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility.
update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, true );
}
if ( ! $value && ! $allow_list_enabled ) {
// @phan-suppress-next-line PhanDeprecatedClassConstant -- Needed for backwards compatibility.
update_option( Waf_Rules_Manager::IP_LISTS_ENABLED_OPTION_NAME, false );
}
}
Expand Down

0 comments on commit 4f0663f

Please sign in to comment.