# woocommerce-pos/1.10.18/includes/Sync/Request_Int_Param.php

WCPOS – Point of Sale (POS) plugin for WooCommerce, version 1.10.18. 27 lines.

- Page: https://pluginprobe.com/plugins/woocommerce-pos/1.10.18/code/includes/Sync/Request_Int_Param.php
- Raw: https://pluginprobe.com/plugins/woocommerce-pos/1.10.18/raw/includes/Sync/Request_Int_Param.php
- Modified: 2026-08-25T07:52:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/woocommerce-pos/1.10.18/code/includes/Sync/Request_Int_Param.php#L10-L20`.

```php
<?php
/**
 * WCPOS sync read surface.
 *
 * @package WCPOS\WooCommercePOS\Sync
 */

namespace WCPOS\WooCommercePOS\Sync;

use WP_REST_Request;

// phpcs:disable Squiz.Commenting, Generic.Commenting -- Ported lab documentation is preserved verbatim.

/**
 * Shared clamped-int request-param reader (previously duplicated verbatim in
 * the changes and integrity controllers): absent/blank falls back to the
 * default, everything is clamped into [$min, $max].
 */
trait Request_Int_Param {
	private function int_param( WP_REST_Request $request, string $key, int $default, int $min, int $max ): int {
		$raw   = $request->get_param( $key );
		$value = ( null === $raw || '' === $raw ) ? $default : (int) $raw;

		return max( $min, min( $max, $value ) );
	}
}

```
