Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-theme-upgrader.php

    r41909 r42343  
    4444     */
    4545    public function upgrade_strings() {
    46         $this->strings['up_to_date'] = __('The theme is at the latest version.');
    47         $this->strings['no_package'] = __('Update package not available.');
     46        $this->strings['up_to_date'] = __( 'The theme is at the latest version.' );
     47        $this->strings['no_package'] = __( 'Update package not available.' );
    4848        /* translators: %s: package URL */
    4949        $this->strings['downloading_package'] = sprintf( __( 'Downloading update from %s&#8230;' ), '<span class="code">%s</span>' );
    50         $this->strings['unpack_package'] = __('Unpacking the update&#8230;');
    51         $this->strings['remove_old'] = __('Removing the old version of the theme&#8230;');
    52         $this->strings['remove_old_failed'] = __('Could not remove the old theme.');
    53         $this->strings['process_failed'] = __('Theme update failed.');
    54         $this->strings['process_success'] = __('Theme updated successfully.');
     50        $this->strings['unpack_package']      = __( 'Unpacking the update&#8230;' );
     51        $this->strings['remove_old']          = __( 'Removing the old version of the theme&#8230;' );
     52        $this->strings['remove_old_failed']   = __( 'Could not remove the old theme.' );
     53        $this->strings['process_failed']      = __( 'Theme update failed.' );
     54        $this->strings['process_success']     = __( 'Theme updated successfully.' );
    5555    }
    5656
     
    6161     */
    6262    public function install_strings() {
    63         $this->strings['no_package'] = __('Installation package not available.');
     63        $this->strings['no_package'] = __( 'Installation package not available.' );
    6464        /* translators: %s: package URL */
    6565        $this->strings['downloading_package'] = sprintf( __( 'Downloading installation package from %s&#8230;' ), '<span class="code">%s</span>' );
    66         $this->strings['unpack_package'] = __('Unpacking the package&#8230;');
    67         $this->strings['installing_package'] = __('Installing the theme&#8230;');
    68         $this->strings['no_files'] = __('The theme contains no files.');
    69         $this->strings['process_failed'] = __('Theme installation failed.');
    70         $this->strings['process_success'] = __('Theme installed successfully.');
     66        $this->strings['unpack_package']      = __( 'Unpacking the package&#8230;' );
     67        $this->strings['installing_package']  = __( 'Installing the theme&#8230;' );
     68        $this->strings['no_files']            = __( 'The theme contains no files.' );
     69        $this->strings['process_failed']      = __( 'Theme installation failed.' );
     70        $this->strings['process_success']     = __( 'Theme installed successfully.' );
    7171        /* translators: 1: theme name, 2: version */
    72         $this->strings['process_success_specific'] = __('Successfully installed the theme <strong>%1$s %2$s</strong>.');
    73         $this->strings['parent_theme_search'] = __('This theme requires a parent theme. Checking if it is installed&#8230;');
     72        $this->strings['process_success_specific'] = __( 'Successfully installed the theme <strong>%1$s %2$s</strong>.' );
     73        $this->strings['parent_theme_search']      = __( 'This theme requires a parent theme. Checking if it is installed&#8230;' );
    7474        /* translators: 1: theme name, 2: version */
    75         $this->strings['parent_theme_prepare_install'] = __('Preparing to install <strong>%1$s %2$s</strong>&#8230;');
     75        $this->strings['parent_theme_prepare_install'] = __( 'Preparing to install <strong>%1$s %2$s</strong>&#8230;' );
    7676        /* translators: 1: theme name, 2: version */
    77         $this->strings['parent_theme_currently_installed'] = __('The parent theme, <strong>%1$s %2$s</strong>, is currently installed.');
     77        $this->strings['parent_theme_currently_installed'] = __( 'The parent theme, <strong>%1$s %2$s</strong>, is currently installed.' );
    7878        /* translators: 1: theme name, 2: version */
    79         $this->strings['parent_theme_install_success'] = __('Successfully installed the parent theme, <strong>%1$s %2$s</strong>.');
     79        $this->strings['parent_theme_install_success'] = __( 'Successfully installed the parent theme, <strong>%1$s %2$s</strong>.' );
    8080        /* translators: %s: theme name */
    8181        $this->strings['parent_theme_not_found'] = sprintf( __( '<strong>The parent theme could not be found.</strong> You will need to install the parent theme, %s, before you can use this child theme.' ), '<strong>%s</strong>' );
     
    9898        $theme_info = $this->theme_info();
    9999
    100         if ( ! $theme_info->parent() )
     100        if ( ! $theme_info->parent() ) {
    101101            return $install_result;
     102        }
    102103
    103104        $this->skin->feedback( 'parent_theme_search' );
    104105
    105106        if ( ! $theme_info->parent()->errors() ) {
    106             $this->skin->feedback( 'parent_theme_currently_installed', $theme_info->parent()->display('Name'), $theme_info->parent()->display('Version') );
     107            $this->skin->feedback( 'parent_theme_currently_installed', $theme_info->parent()->display( 'Name' ), $theme_info->parent()->display( 'Version' ) );
    107108            // We already have the theme, fall through.
    108109            return $install_result;
     
    110111
    111112        // We don't have the parent theme, let's install it.
    112         $api = themes_api('theme_information', array('slug' => $theme_info->get('Template'), 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth.
    113 
    114         if ( ! $api || is_wp_error($api) ) {
    115             $this->skin->feedback( 'parent_theme_not_found', $theme_info->get('Template') );
     113        $api = themes_api(
     114            'theme_information', array(
     115                'slug'   => $theme_info->get( 'Template' ),
     116                'fields' => array(
     117                    'sections' => false,
     118                    'tags'     => false,
     119                ),
     120            )
     121        ); //Save on a bit of bandwidth.
     122
     123        if ( ! $api || is_wp_error( $api ) ) {
     124            $this->skin->feedback( 'parent_theme_not_found', $theme_info->get( 'Template' ) );
    116125            // Don't show activate or preview actions after installation
    117             add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
     126            add_filter( 'install_theme_complete_actions', array( $this, 'hide_activate_preview_actions' ) );
    118127            return $install_result;
    119128        }
    120129
    121130        // Backup required data we're going to override:
    122         $child_api = $this->skin->api;
     131        $child_api             = $this->skin->api;
    123132        $child_success_message = $this->strings['process_success'];
    124133
    125134        // Override them
    126         $this->skin->api = $api;
     135        $this->skin->api                           = $api;
    127136        $this->strings['process_success_specific'] = $this->strings['parent_theme_install_success'];//, $api->name, $api->version);
    128137
    129         $this->skin->feedback('parent_theme_prepare_install', $api->name, $api->version);
    130 
    131         add_filter('install_theme_complete_actions', '__return_false', 999); // Don't show any actions after installing the theme.
     138        $this->skin->feedback( 'parent_theme_prepare_install', $api->name, $api->version );
     139
     140        add_filter( 'install_theme_complete_actions', '__return_false', 999 ); // Don't show any actions after installing the theme.
    132141
    133142        // Install the parent theme
    134         $parent_result = $this->run( array(
    135             'package' => $api->download_link,
    136             'destination' => get_theme_root(),
    137             'clear_destination' => false, //Do not overwrite files.
    138             'clear_working' => true
    139         ) );
    140 
    141         if ( is_wp_error($parent_result) )
    142             add_filter('install_theme_complete_actions', array($this, 'hide_activate_preview_actions') );
     143        $parent_result = $this->run(
     144            array(
     145                'package'           => $api->download_link,
     146                'destination'       => get_theme_root(),
     147                'clear_destination' => false, //Do not overwrite files.
     148                'clear_working'     => true,
     149            )
     150        );
     151
     152        if ( is_wp_error( $parent_result ) ) {
     153            add_filter( 'install_theme_complete_actions', array( $this, 'hide_activate_preview_actions' ) );
     154        }
    143155
    144156        // Start cleaning up after the parents installation
    145         remove_filter('install_theme_complete_actions', '__return_false', 999);
     157        remove_filter( 'install_theme_complete_actions', '__return_false', 999 );
    146158
    147159        // Reset child's result and data
    148         $this->result = $child_result;
    149         $this->skin->api = $child_api;
     160        $this->result                     = $child_result;
     161        $this->skin->api                  = $child_api;
    150162        $this->strings['process_success'] = $child_success_message;
    151163
     
    166178     */
    167179    public function hide_activate_preview_actions( $actions ) {
    168         unset($actions['activate'], $actions['preview']);
     180        unset( $actions['activate'], $actions['preview'] );
    169181        return $actions;
    170182    }
     
    188200    public function install( $package, $args = array() ) {
    189201
    190         $defaults = array(
     202        $defaults    = array(
    191203            'clear_update_cache' => true,
    192204        );
     
    196208        $this->install_strings();
    197209
    198         add_filter('upgrader_source_selection', array($this, 'check_package') );
    199         add_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'), 10, 3);
     210        add_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
     211        add_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ), 10, 3 );
    200212        if ( $parsed_args['clear_update_cache'] ) {
    201213            // Clear cache so wp_update_themes() knows about the new theme.
     
    203215        }
    204216
    205         $this->run( array(
    206             'package' => $package,
    207             'destination' => get_theme_root(),
    208             'clear_destination' => false, //Do not overwrite files.
    209             'clear_working' => true,
    210             'hook_extra' => array(
    211                 'type' => 'theme',
    212                 'action' => 'install',
    213             ),
    214         ) );
     217        $this->run(
     218            array(
     219                'package'           => $package,
     220                'destination'       => get_theme_root(),
     221                'clear_destination' => false, //Do not overwrite files.
     222                'clear_working'     => true,
     223                'hook_extra'        => array(
     224                    'type'   => 'theme',
     225                    'action' => 'install',
     226                ),
     227            )
     228        );
    215229
    216230        remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
    217         remove_filter('upgrader_source_selection', array($this, 'check_package') );
    218         remove_filter('upgrader_post_install', array($this, 'check_parent_theme_filter'));
    219 
    220         if ( ! $this->result || is_wp_error($this->result) )
     231        remove_filter( 'upgrader_source_selection', array( $this, 'check_package' ) );
     232        remove_filter( 'upgrader_post_install', array( $this, 'check_parent_theme_filter' ) );
     233
     234        if ( ! $this->result || is_wp_error( $this->result ) ) {
    221235            return $this->result;
     236        }
    222237
    223238        // Refresh the Theme Update information
     
    244259    public function upgrade( $theme, $args = array() ) {
    245260
    246         $defaults = array(
     261        $defaults    = array(
    247262            'clear_update_cache' => true,
    248263        );
     
    254269        // Is an update available?
    255270        $current = get_site_transient( 'update_themes' );
    256         if ( !isset( $current->response[ $theme ] ) ) {
     271        if ( ! isset( $current->response[ $theme ] ) ) {
    257272            $this->skin->before();
    258             $this->skin->set_result(false);
     273            $this->skin->set_result( false );
    259274            $this->skin->error( 'up_to_date' );
    260275            $this->skin->after();
     
    264279        $r = $current->response[ $theme ];
    265280
    266         add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
    267         add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
    268         add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
     281        add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
     282        add_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );
     283        add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
    269284        if ( $parsed_args['clear_update_cache'] ) {
    270285            // Clear cache so wp_update_themes() knows about the new theme.
     
    272287        }
    273288
    274         $this->run( array(
    275             'package' => $r['package'],
    276             'destination' => get_theme_root( $theme ),
    277             'clear_destination' => true,
    278             'clear_working' => true,
    279             'hook_extra' => array(
    280                 'theme' => $theme,
    281                 'type' => 'theme',
    282                 'action' => 'update',
    283             ),
    284         ) );
     289        $this->run(
     290            array(
     291                'package'           => $r['package'],
     292                'destination'       => get_theme_root( $theme ),
     293                'clear_destination' => true,
     294                'clear_working'     => true,
     295                'hook_extra'        => array(
     296                    'theme'  => $theme,
     297                    'type'   => 'theme',
     298                    'action' => 'update',
     299                ),
     300            )
     301        );
    285302
    286303        remove_action( 'upgrader_process_complete', 'wp_clean_themes_cache', 9 );
    287         remove_filter('upgrader_pre_install', array($this, 'current_before'));
    288         remove_filter('upgrader_post_install', array($this, 'current_after'));
    289         remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
    290 
    291         if ( ! $this->result || is_wp_error($this->result) )
     304        remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
     305        remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
     306        remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
     307
     308        if ( ! $this->result || is_wp_error( $this->result ) ) {
    292309            return $this->result;
     310        }
    293311
    294312        wp_clean_themes_cache( $parsed_args['clear_update_cache'] );
     
    314332    public function bulk_upgrade( $themes, $args = array() ) {
    315333
    316         $defaults = array(
     334        $defaults    = array(
    317335            'clear_update_cache' => true,
    318336        );
     
    325343        $current = get_site_transient( 'update_themes' );
    326344
    327         add_filter('upgrader_pre_install', array($this, 'current_before'), 10, 2);
    328         add_filter('upgrader_post_install', array($this, 'current_after'), 10, 2);
    329         add_filter('upgrader_clear_destination', array($this, 'delete_old_theme'), 10, 4);
     345        add_filter( 'upgrader_pre_install', array( $this, 'current_before' ), 10, 2 );
     346        add_filter( 'upgrader_post_install', array( $this, 'current_after' ), 10, 2 );
     347        add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ), 10, 4 );
    330348
    331349        $this->skin->header();
    332350
    333351        // Connect to the Filesystem first.
    334         $res = $this->fs_connect( array(WP_CONTENT_DIR) );
     352        $res = $this->fs_connect( array( WP_CONTENT_DIR ) );
    335353        if ( ! $res ) {
    336354            $this->skin->footer();
     
    345363        // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible.
    346364        $maintenance = ( is_multisite() && ! empty( $themes ) );
    347         foreach ( $themes as $theme )
     365        foreach ( $themes as $theme ) {
    348366            $maintenance = $maintenance || $theme == get_stylesheet() || $theme == get_template();
    349         if ( $maintenance )
    350             $this->maintenance_mode(true);
     367        }
     368        if ( $maintenance ) {
     369            $this->maintenance_mode( true );
     370        }
    351371
    352372        $results = array();
    353373
    354         $this->update_count = count($themes);
     374        $this->update_count   = count( $themes );
    355375        $this->update_current = 0;
    356376        foreach ( $themes as $theme ) {
    357377            $this->update_current++;
    358378
    359             $this->skin->theme_info = $this->theme_info($theme);
    360 
    361             if ( !isset( $current->response[ $theme ] ) ) {
    362                 $this->skin->set_result(true);
     379            $this->skin->theme_info = $this->theme_info( $theme );
     380
     381            if ( ! isset( $current->response[ $theme ] ) ) {
     382                $this->skin->set_result( true );
    363383                $this->skin->before();
    364384                $this->skin->feedback( 'up_to_date' );
    365385                $this->skin->after();
    366                 $results[$theme] = true;
     386                $results[ $theme ] = true;
    367387                continue;
    368388            }
     
    371391            $r = $current->response[ $theme ];
    372392
    373             $result = $this->run( array(
    374                 'package' => $r['package'],
    375                 'destination' => get_theme_root( $theme ),
    376                 'clear_destination' => true,
    377                 'clear_working' => true,
    378                 'is_multi' => true,
    379                 'hook_extra' => array(
    380                     'theme' => $theme
    381                 ),
    382             ) );
    383 
    384             $results[$theme] = $this->result;
     393            $result = $this->run(
     394                array(
     395                    'package'           => $r['package'],
     396                    'destination'       => get_theme_root( $theme ),
     397                    'clear_destination' => true,
     398                    'clear_working'     => true,
     399                    'is_multi'          => true,
     400                    'hook_extra'        => array(
     401                        'theme' => $theme,
     402                    ),
     403                )
     404            );
     405
     406            $results[ $theme ] = $this->result;
    385407
    386408            // Prevent credentials auth screen from displaying multiple times
    387             if ( false === $result )
     409            if ( false === $result ) {
    388410                break;
     411            }
    389412        } //end foreach $plugins
    390413
    391         $this->maintenance_mode(false);
     414        $this->maintenance_mode( false );
    392415
    393416        // Refresh the Theme Update information
     
    395418
    396419        /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
    397         do_action( 'upgrader_process_complete', $this, array(
    398             'action' => 'update',
    399             'type' => 'theme',
    400             'bulk' => true,
    401             'themes' => $themes,
    402         ) );
     420        do_action(
     421            'upgrader_process_complete', $this, array(
     422                'action' => 'update',
     423                'type'   => 'theme',
     424                'bulk'   => true,
     425                'themes' => $themes,
     426            )
     427        );
    403428
    404429        $this->skin->bulk_footer();
     
    407432
    408433        // Cleanup our hooks, in case something else does a upgrade on this connection.
    409         remove_filter('upgrader_pre_install', array($this, 'current_before'));
    410         remove_filter('upgrader_post_install', array($this, 'current_after'));
    411         remove_filter('upgrader_clear_destination', array($this, 'delete_old_theme'));
     434        remove_filter( 'upgrader_pre_install', array( $this, 'current_before' ) );
     435        remove_filter( 'upgrader_post_install', array( $this, 'current_after' ) );
     436        remove_filter( 'upgrader_clear_destination', array( $this, 'delete_old_theme' ) );
    412437
    413438        return $results;
     
    431456        global $wp_filesystem;
    432457
    433         if ( is_wp_error($source) )
     458        if ( is_wp_error( $source ) ) {
    434459            return $source;
     460        }
    435461
    436462        // Check the folder contains a valid theme
    437         $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit(WP_CONTENT_DIR), $source);
    438         if ( ! is_dir($working_directory) ) // Sanity check, if the above fails, let's not prevent installation.
     463        $working_directory = str_replace( $wp_filesystem->wp_content_dir(), trailingslashit( WP_CONTENT_DIR ), $source );
     464        if ( ! is_dir( $working_directory ) ) { // Sanity check, if the above fails, let's not prevent installation.
    439465            return $source;
     466        }
    440467
    441468        // A proper archive should have a style.css file in the single subdirectory
    442469        if ( ! file_exists( $working_directory . 'style.css' ) ) {
    443             return new WP_Error( 'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'],
     470            return new WP_Error(
     471                'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'],
    444472                /* translators: %s: style.css */
    445                 sprintf( __( 'The theme is missing the %s stylesheet.' ),
     473                sprintf(
     474                    __( 'The theme is missing the %s stylesheet.' ),
    446475                    '<code>style.css</code>'
    447476                )
     
    449478        }
    450479
    451         $info = get_file_data( $working_directory . 'style.css', array( 'Name' => 'Theme Name', 'Template' => 'Template' ) );
     480        $info = get_file_data(
     481            $working_directory . 'style.css', array(
     482                'Name'     => 'Theme Name',
     483                'Template' => 'Template',
     484            )
     485        );
    452486
    453487        if ( empty( $info['Name'] ) ) {
    454             return new WP_Error( 'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'],
     488            return new WP_Error(
     489                'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'],
    455490                /* translators: %s: style.css */
    456                 sprintf( __( 'The %s stylesheet doesn&#8217;t contain a valid theme header.' ),
     491                sprintf(
     492                    __( 'The %s stylesheet doesn&#8217;t contain a valid theme header.' ),
    457493                    '<code>style.css</code>'
    458494                )
     
    462498        // If it's not a child theme, it must have at least an index.php to be legit.
    463499        if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) {
    464             return new WP_Error( 'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'],
     500            return new WP_Error(
     501                'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'],
    465502                /* translators: %s: index.php */
    466                 sprintf( __( 'The theme is missing the %s file.' ),
     503                sprintf(
     504                    __( 'The theme is missing the %s file.' ),
    467505                    '<code>index.php</code>'
    468506                )
     
    485523     * @return bool|WP_Error
    486524     */
    487     public function current_before($return, $theme) {
    488         if ( is_wp_error($return) )
     525    public function current_before( $return, $theme ) {
     526        if ( is_wp_error( $return ) ) {
    489527            return $return;
    490 
    491         $theme = isset($theme['theme']) ? $theme['theme'] : '';
    492 
    493         if ( $theme != get_stylesheet() ) //If not current
     528        }
     529
     530        $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
     531
     532        if ( $theme != get_stylesheet() ) { //If not current
    494533            return $return;
     534        }
    495535        //Change to maintenance mode now.
    496         if ( ! $this->bulk )
    497             $this->maintenance_mode(true);
     536        if ( ! $this->bulk ) {
     537            $this->maintenance_mode( true );
     538        }
    498539
    499540        return $return;
     
    512553     * @return bool|WP_Error
    513554     */
    514     public function current_after($return, $theme) {
    515         if ( is_wp_error($return) )
     555    public function current_after( $return, $theme ) {
     556        if ( is_wp_error( $return ) ) {
    516557            return $return;
    517 
    518         $theme = isset($theme['theme']) ? $theme['theme'] : '';
    519 
    520         if ( $theme != get_stylesheet() ) // If not current
     558        }
     559
     560        $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
     561
     562        if ( $theme != get_stylesheet() ) { // If not current
    521563            return $return;
     564        }
    522565
    523566        // Ensure stylesheet name hasn't changed after the upgrade:
     
    529572
    530573        //Time to remove maintenance mode
    531         if ( ! $this->bulk )
    532             $this->maintenance_mode(false);
     574        if ( ! $this->bulk ) {
     575            $this->maintenance_mode( false );
     576        }
    533577        return $return;
    534578    }
     
    553597        global $wp_filesystem;
    554598
    555         if ( is_wp_error( $removed ) )
     599        if ( is_wp_error( $removed ) ) {
    556600            return $removed; // Pass errors through.
    557 
    558         if ( ! isset( $theme['theme'] ) )
     601        }
     602
     603        if ( ! isset( $theme['theme'] ) ) {
    559604            return $removed;
    560 
    561         $theme = $theme['theme'];
     605        }
     606
     607        $theme      = $theme['theme'];
    562608        $themes_dir = trailingslashit( $wp_filesystem->wp_themes_dir( $theme ) );
    563609        if ( $wp_filesystem->exists( $themes_dir . $theme ) ) {
    564             if ( ! $wp_filesystem->delete( $themes_dir . $theme, true ) )
     610            if ( ! $wp_filesystem->delete( $themes_dir . $theme, true ) ) {
    565611                return false;
     612            }
    566613        }
    567614
     
    580627     *                        and the last result isn't set.
    581628     */
    582     public function theme_info($theme = null) {
    583 
    584         if ( empty($theme) ) {
    585             if ( !empty($this->result['destination_name']) )
     629    public function theme_info( $theme = null ) {
     630
     631        if ( empty( $theme ) ) {
     632            if ( ! empty( $this->result['destination_name'] ) ) {
    586633                $theme = $this->result['destination_name'];
    587             else
     634            } else {
    588635                return false;
     636            }
    589637        }
    590638        return wp_get_theme( $theme );
Note: See TracChangeset for help on using the changeset viewer.