diff --git a/includes/RestApi/FlowController.php b/includes/RestApi/FlowController.php index 625b143e4..78009ab0c 100644 --- a/includes/RestApi/FlowController.php +++ b/includes/RestApi/FlowController.php @@ -127,10 +127,12 @@ public function save_onboarding_flow_data( \WP_REST_Request $request ) { /** * Flow completion API for child theme generation, verify child theme and publish site pages. * + * @param \WP_REST_Request $request The incoming request. + * * @return \WP_REST_Response|\WP_Error */ public function complete( $request ) { - $flow = $request->get_param('flow'); + $flow = $request->get_param( 'flow' ); if ( 'sitegen' === $flow ) { $flow_data_option = \get_option( Options::get_option_name( 'flow' ), false ); if ( false === $flow_data_option || ! isset( $flow_data_option['data'] ) ) { @@ -140,13 +142,13 @@ public function complete( $request ) { array( 'status' => 500 ) ); } - $homepage_data = $flow_data_option['sitegen']['homepages']['data']; - $active_homepage = $flow_data_option['sitegen']['homepages']['active']; - SiteGenService::complete( $active_homepage, $homepage_data ); - return new \WP_REST_Response( - array(), - 201 - ); + $homepage_data = $flow_data_option['sitegen']['homepages']['data']; + $active_homepage = $flow_data_option['sitegen']['homepages']['active']; + SiteGenService::complete( $active_homepage, $homepage_data ); + return new \WP_REST_Response( + array(), + 201 + ); } $site_pages_publish_request = new \WP_REST_Request( diff --git a/includes/RestApi/SiteGenController.php b/includes/RestApi/SiteGenController.php index 1d993bcba..8f2be97f3 100644 --- a/includes/RestApi/SiteGenController.php +++ b/includes/RestApi/SiteGenController.php @@ -104,6 +104,5 @@ public function generate_sitegen_meta( \WP_REST_Request $request ) { // TODO Implement the main function and do computations if required. return SiteGenService::instantiate_site_meta( $site_info, $identifier, $skip_cache ); - } }