Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions abilities/class-ability-get-alerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,11 @@ public function get_output_schema() {
public function execute( $input = null ) {
$requested = isset( $input['status'] ) ? $input['status'] : 'any';

switch ( $requested ) {
case 'enabled':
$statuses = array( Alerts::STATUS_ENABLED );
break;
case 'disabled':
$statuses = array( Alerts::STATUS_DISABLED );
break;
default:
$statuses = array( Alerts::STATUS_ENABLED, Alerts::STATUS_DISABLED );
}
$statuses = match ( $requested ) {
'enabled' => array( Alerts::STATUS_ENABLED ),
'disabled' => array( Alerts::STATUS_DISABLED ),
default => array( Alerts::STATUS_ENABLED, Alerts::STATUS_DISABLED ),
};

$alerts = $this->plugin->alerts->get_alerts( $statuses );

Expand Down
27 changes: 8 additions & 19 deletions classes/class-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -1167,25 +1167,14 @@ public function screen_controls( $status, $args ) {
* @return string setting name for that column
*/
public function get_column_excluded_setting_key( $column ) {
switch ( $column ) {
case 'connector':
$output = 'connectors';
break;
case 'context':
$output = 'contexts';
break;
case 'action':
$output = 'action';
break;
case 'ip':
$output = 'ip_addresses';
break;
case 'user_id':
$output = 'users';
break;
default:
$output = false;
}
$output = match ( $column ) {
'connector' => 'connectors',
'context' => 'contexts',
'action' => 'action',
'ip' => 'ip_addresses',
'user_id' => 'users',
default => false,
};

return $output;
}
Expand Down
3 changes: 2 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php80\Rector\Switch_\ChangeSwitchToMatchRector;
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector;
use Rector\ValueObject\PhpVersion;

Expand Down Expand Up @@ -41,7 +42,7 @@
)
->withPhpVersion( PhpVersion::PHP_82 )
->withCache( __DIR__ . '/artifacts/rector' )
->withRules( array() )
->withRules( array( ChangeSwitchToMatchRector::class ) )
->withConfiguredRule(
TypedPropertyFromAssignsRector::class,
array( TypedPropertyFromAssignsRector::INLINE_PUBLIC => true )
Expand Down
Loading