PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.17
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.17
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 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 All 163 releases
woocommerce-pos / includes / Vendor_Prefixed_Polyfills.php

Vendor_Prefixed_Polyfills.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.17, at includes/Vendor_Prefixed_Polyfills.php

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Polyfills for functions accidentally prefixed in vendored dependencies.
4 *
5 * The authoritative fix lives in php-scoper/scoper.inc.php (exclude-functions),
6 * which stops the scoper from prefixing these calls in the first place. This
7 * shim only protects sites still running a vendor_prefixed build produced
8 * before that fix; do not add new symbols here — exclude them in the scoper
9 * config instead.
10 *
11 * @package WCPOS\Vendor
12 */
13
14 namespace WCPOS\Vendor; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound -- matches prefixed vendor namespace.
15
16 if ( ! \function_exists( __NAMESPACE__ . '\\http_get_last_response_headers' ) ) {
17 /**
18 * Proxy PHP's response-header helper for prefixed vendor code.
19 *
20 * @return array<int, string>
21 */
22 function http_get_last_response_headers(): array {
23 if ( \function_exists( 'http_get_last_response_headers' ) ) {
24 $headers = \http_get_last_response_headers();
25
26 return \is_array( $headers ) ? $headers : array();
27 }
28
29 return array();
30 }
31 }
32
33 if ( ! \function_exists( __NAMESPACE__ . '\\http_clear_last_response_headers' ) ) {
34 /**
35 * Proxy PHP's response-header reset helper for prefixed vendor code.
36 */
37 function http_clear_last_response_headers(): void {
38 if ( \function_exists( 'http_clear_last_response_headers' ) ) {
39 \http_clear_last_response_headers();
40 }
41 }
42 }
43