# packeta/trunk/src/Packetery/Module/FormRules.php

Packeta, version trunk. 43 lines.

- Page: https://pluginprobe.com/plugins/packeta/trunk/code/src/Packetery/Module/FormRules.php
- Raw: https://pluginprobe.com/plugins/packeta/trunk/raw/src/Packetery/Module/FormRules.php
- Modified: 2025-03-10T10:47:38+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/packeta/trunk/code/src/Packetery/Module/FormRules.php#L10-L20`.

```php
<?php
/**
 * Class FormRules.
 *
 * @package Packetery
 */

declare(strict_types=1);

namespace Packetery\Module;

/**
 * Class FormRules.
 */
class FormRules {
	/**
	 * Creates greaterThan validator parts for addRule form method.
	 *
	 * @param float $threshold Threshold.
	 * @return array{array{class-string<FormValidators>, 'greaterThan'}, string, float}
	 */
	public static function getGreaterThanParameters( float $threshold ): array {
		return [
			[ FormValidators::class, 'greaterThan' ],
			// translators: %d is numeric threshold.
			__( 'Enter number greater than %d', 'packeta' ),
			$threshold,
		];
	}

	/**
	 * Creates date validator parts for addRule form method.
	 *
	 * @return array{array{class-string<FormValidators>, 'dateIsInMysqlFormat'}, string}
	 */
	public static function getDateParameters(): array {
		return [
			[ FormValidators::class, 'dateIsInMysqlFormat' ],
			__( 'Please enter date in proper format.', 'packeta' ),
		];
	}
}

```
