PluginProbe
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping / trunk
Weight Based Shipping Table Rate for WooCommerce – Flexible Shipping vtrunk
6.12.1 6.12.0 6.11.0 6.10.0 6.9.1 6.9.0 6.8.1 6.8.0 6.7.4 6.7.3 6.7.2 6.7.0 4.21.7 4.22.0 4.22.1 4.23.0 4.23.1 4.23.2 4.23.3 4.24.0 4.24.1 4.24.10 4.24.11 4.24.12 4.24.13 All 285 releases
flexible-shipping / src / WPDesk / FS / TableRate / FreeShipping / LffsNoticeTextFormatValidator.php
LffsNoticeTextFormatValidator.php
36 lines 563 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class LffsNoticeTextFormatValidator
4 *
5 * @package WPDesk\FS\TableRate\FreeShipping
6 */
7
8 declare( strict_types=1 );
9
10 namespace WPDesk\FS\TableRate\FreeShipping;
11
12 /**
13 * Validates LFFS notice text placeholder format.
14 */
15 final class LffsNoticeTextFormatValidator {
16
17 /**
18 * @param string $message LFFS notice text.
19 *
20 * @return bool
21 */
22 public function is_valid( string $message ): bool {
23 if ( '' === $message ) {
24 return true;
25 }
26
27 try {
28 sprintf( $message, '' );
29 } catch ( \Throwable $e ) {
30 return false;
31 }
32
33 return true;
34 }
35 }
36