Making WordPress.org

Ticket #4747: 4747.tide.switch.diff

File 4747.tide.switch.diff, 931 bytes (added by garrett-eclipse, 5 years ago)

Alternate patch to change the if else block to a simpler switch case

  • common/includes/slack/announce/lib.php

     
    133133        list( $parent_channel, ) = explode( '-', $channel, 2 );
    134134
    135135        // Some channels parents are not a 1:1 match.
    136         if ( 'accessibility' === $parent_channel ) {
    137                 $parent_channel = 'core';
    138         } elseif ( 'design' === $parent_channel ) {
    139                 $parent_channel = 'core';
    140         } elseif ( 'feature' === $parent_channel ) {
    141                 $parent_channel = 'core';
    142         } elseif ( 'community' === $parent_channel ) {
    143                 $parent_channel = 'community-team';
     136        switch ( $parent_channel ) {
     137                case 'community':
     138                        $parent_channel = 'community-team';
     139                        break;
     140                case 'accessibility':
     141                case 'design':
     142                case 'tide':
     143                case 'feature':
     144                        $parent_channel = 'core';
     145                        break;
    144146        }
    145147
    146148        // Validate the channel.