@@ -151,12 +151,18 @@ function static_site_importer_register_abilities(): void {
151151 'type ' => 'object ' ,
152152 'properties ' => array_merge (
153153 array (
154- 'operation ' => array ( 'type ' => 'string ' , 'enum ' => array ( 'plan ' , 'apply ' ) ),
154+ 'operation ' => array (
155+ 'type ' => 'string ' ,
156+ 'enum ' => array ( 'plan ' , 'apply ' ),
157+ ),
155158 'plan ' => array ( 'type ' => 'object ' ),
156159 'source ' => array (
157160 'type ' => 'object ' ,
158161 'properties ' => array (
159- 'type ' => array ( 'type ' => 'string ' , 'enum ' => array ( 'artifact ' , 'url ' , 'upload ' ) ),
162+ 'type ' => array (
163+ 'type ' => 'string ' ,
164+ 'enum ' => array ( 'artifact ' , 'url ' , 'upload ' ),
165+ ),
160166 'artifact ' => array ( 'type ' => 'object ' ),
161167 'url ' => array ( 'type ' => 'string ' ),
162168 'import_id ' => array ( 'type ' => 'string ' ),
@@ -395,7 +401,7 @@ function static_site_importer_ability_export_theme( array $input ): array {
395401if ( ! function_exists ( 'static_site_importer_ability_import ' ) ) {
396402 /** Canonical plan-first import dispatcher. */
397403 function static_site_importer_ability_import ( array $ input ): array {
398- $ source = isset ( $ input ['source ' ] ) && is_array ( $ input ['source ' ] ) ? $ input ['source ' ] : array ();
404+ $ source = isset ( $ input ['source ' ] ) && is_array ( $ input ['source ' ] ) ? $ input ['source ' ] : array ();
399405 $ type = (string ) ( $ source ['type ' ] ?? '' );
400406 $ operation = (string ) ( $ input ['operation ' ] ?? 'apply ' );
401407 if ( ! in_array ( $ operation , array ( 'plan ' , 'apply ' ), true ) ) {
@@ -525,9 +531,9 @@ function static_site_importer_ability_import_url_operation( array $input, array
525531 'type ' => 'url ' ,
526532 'identity ' => hash ( 'sha256 ' , (string ) wp_json_encode ( $ terminal ['plan ' ] ) ),
527533 'provenance ' => array (
528- 'url ' => (string ) ( $ source ['url ' ] ?? '' ),
529- 'import_id ' => (string ) ( $ result ['import_id ' ] ?? '' ),
530- 'url_batch_run ' => $ continuation ['url_batch_run ' ],
534+ 'url ' => (string ) ( $ source ['url ' ] ?? '' ),
535+ 'import_id ' => (string ) ( $ result ['import_id ' ] ?? '' ),
536+ 'url_batch_run ' => $ continuation ['url_batch_run ' ],
531537 ),
532538 ),
533539 )
@@ -538,7 +544,7 @@ function static_site_importer_ability_import_url_operation( array $input, array
538544if ( ! function_exists ( 'static_site_importer_ability_apply_approved_plan ' ) ) {
539545 /** @param array<string,mixed> $input @return array<string,mixed> */
540546 function static_site_importer_ability_apply_approved_plan ( array $ input ): array {
541- $ plan = $ input ['plan ' ];
547+ $ plan = $ input ['plan ' ];
542548 $ receipt = static_site_importer_ability_materialize_wordpress_site_plan ( $ input );
543549 $ success = 'completed ' === ( $ receipt ['status ' ] ?? '' );
544550
@@ -547,7 +553,10 @@ function static_site_importer_ability_apply_approved_plan( array $input ): array
547553 'operation ' => 'apply ' ,
548554 'plan ' => $ plan ,
549555 'result ' => $ receipt ,
550- 'error ' => $ success ? null : ( $ receipt ['errors ' ][0 ] ?? array ( 'code ' => 'static_site_importer_materialization_failed ' , 'message ' => 'The approved plan could not be materialized. ' ) ),
556+ 'error ' => $ success ? null : ( $ receipt ['errors ' ][0 ] ?? array (
557+ 'code ' => 'static_site_importer_materialization_failed ' ,
558+ 'message ' => 'The approved plan could not be materialized. ' ,
559+ ) ),
551560 );
552561 }
553562}
0 commit comments