PluginProbe
PostNL for WooCommerce / 5.9.12
PostNL for WooCommerce v5.9.12
5.9.12 5.9.11 5.9.10 5.9.9 5.9.8 5.9.7 5.9.6 trunk 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.1.4 3.1.5 3.1.6 3.1.7 4.0.0 4.0.1 4.0.2 4.3.2 4.3.3 4.4.0 4.4.1 All 72 releases
woo-postnl / src / Rest_API / V4 / Barcode / Service.php

Service.php in PostNL for WooCommerce 5.9.12, at src/Rest_API/V4/Barcode/Service.php

49 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class Rest_API\V4\Barcode\Service file.
4 *
5 * @package PostNLWooCommerce\Rest_API\V4\Barcode
6 */
7
8 declare( strict_types = 1 );
9
10 namespace PostNLWooCommerce\Rest_API\V4\Barcode;
11
12 use PostNLWooCommerce\Rest_API\Contracts\Barcode_Service_Interface;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 /**
19 * Class Service
20 *
21 * V4 barcode "service" — intentionally a no-op.
22 *
23 * V4 has no standalone barcode endpoint: the label call auto-issues the barcode and
24 * returns it, so there is nothing for generate() to request. Order\Base takes the
25 * label-first branch on V4 and never calls generate(); this class exists only so
26 * Service_Factory can return a uniform Barcode_Service_Interface.
27 *
28 * @since 6.0.0
29 * @package PostNLWooCommerce\Rest_API\V4\Barcode
30 */
31 class Service implements Barcode_Service_Interface {
32
33 /**
34 * No-op barcode generation.
35 *
36 * Returns an empty array, which create_barcode() rejects loudly — reaching this
37 * method means the V4 path was mis-wired, not that a barcode is unavailable.
38 *
39 * @param array $post_data Post data (unused on V4).
40 *
41 * @return array Always empty; the barcode is harvested from the label response.
42 *
43 * @since 6.0.0
44 */
45 public function generate( array $post_data ): array {
46 return array();
47 }
48 }
49