Fix lint errors with remote spec validator endpoint (#47520)

* Fix lint errors

* Add changefile(s) from automation for the following project(s): woocommerce-beta-tester

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Moon 2024-05-17 10:25:59 +12:00 committed by GitHub
parent db50513c42
commit 15d146fa84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 6 deletions

View File

@ -9,7 +9,7 @@ register_woocommerce_admin_test_helper_rest_route(
'wca_test_helper_validate_remote_spec',
array(
'methods' => 'POST',
'args' => array(
'args' => array(
'spec' => array(
'description' => 'The remote spec to validate.',
'type' => 'string',
@ -21,14 +21,16 @@ register_woocommerce_admin_test_helper_rest_route(
);
/**
* Test the spec.
*
* @param WP_REST_Request $request The full request data.
*/
function wca_test_helper_validate_remote_spec( $request ) {
$spec = json_decode( $request->get_param( 'spec' ) );
$spec = json_decode( $request->get_param( 'spec' ) );
$rule_evaluator = new RuleEvaluator();
$result = [
$result = array(
'valid' => $rule_evaluator->evaluate( $spec ),
];
return new WP_REST_RESPONSE( $result, 200 );
);
return new WP_REST_Response( $result, 200 );
}

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix lint errors from the remote spec test endpoint.