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:
parent
db50513c42
commit
15d146fa84
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix lint errors from the remote spec test endpoint.
|
Loading…
Reference in New Issue