PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.21
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.21
1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 All 168 releases
woocommerce-pos / includes / API / V2 / Proxy / Fast_Path_Behavior.php

Fast_Path_Behavior.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.21, at includes/API/V2/Proxy/Fast_Path_Behavior.php

32 lines 937 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Optional fast-path contract for a catalog proxy behavior.
4 *
5 * @package WCPOS\WooCommercePOS\API\V2\Proxy
6 */
7
8 namespace WCPOS\WooCommercePOS\API\V2\Proxy;
9
10 use WP_REST_Request;
11 use WP_REST_Response;
12
13 /**
14 * Lets a behavior answer one narrow request shape without the wc/v3 forward.
15 *
16 * A separate interface rather than a new {@see Proxy_Behavior} method, so
17 * existing Proxy_Behavior implementations outside this plugin keep working.
18 */
19 interface Fast_Path_Behavior {
20 /**
21 * Answer the request directly when it is this behavior's fast-path shape.
22 *
23 * The response is returned as-is: no wc/v3 forward, no
24 * `woocommerce_pos_sync_proxy_response` filter, no post-processing.
25 *
26 * @param WP_REST_Request $request Original proxy request.
27 *
28 * @return null|WP_REST_Response Null when the request is not the fast-path shape.
29 */
30 public function fast_response( WP_REST_Request $request ): ?WP_REST_Response;
31 }
32