Skip to content

Commit

Permalink
Fix lint errors with remote spec validator endpoint (#47520)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
moon0326 and github-actions committed May 16, 2024
1 parent db50513 commit 15d146f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'wca_test_helper_validate_remote_spec',
array(
'methods' => 'POST',
'args' => array(
'args' => array(
'spec' => array(
'description' => 'The remote spec to validate.',
'type' => 'string',
Expand All @@ -21,14 +21,16 @@
);

/**
* 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 );
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix lint errors from the remote spec test endpoint.

0 comments on commit 15d146f

Please sign in to comment.