@@ -11,10 +11,10 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Prevent direct file access |
14 | -defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
|
14 | +defined('ABSPATH') or die('No script kiddies please!'); |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Prevent loading the library more than once |
18 | 18 | */ |
19 | -if( defined( 'AMARKAL_VALIDATION' ) ) return false; |
|
20 | -define( 'AMARKAL_VALIDATION', true ); |
|
21 | 19 | \ No newline at end of file |
20 | +if (defined('AMARKAL_VALIDATION')) return false; |
|
21 | +define('AMARKAL_VALIDATION', true); |
|
22 | 22 | \ No newline at end of file |
@@ -6,7 +6,7 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | // Prevent direct file access |
9 | -defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
|
9 | +defined('ABSPATH') or die('No script kiddies please!'); |
|
10 | 10 | |
11 | 11 | // Load module functions |
12 | 12 | require_once 'functions.php'; |
@@ -4,23 +4,23 @@ |
||
4 | 4 | |
5 | 5 | class Strings |
6 | 6 | { |
7 | - static function length_less_than( $str, $length ) |
|
7 | + static function length_less_than($str, $length) |
|
8 | 8 | { |
9 | 9 | return strlen($str) < $length; |
10 | 10 | } |
11 | 11 | |
12 | - static function length_greater_than( $str, $length ) |
|
12 | + static function length_greater_than($str, $length) |
|
13 | 13 | { |
14 | 14 | return strlen($str) > $length; |
15 | 15 | } |
16 | 16 | |
17 | - static function match( $str, $regex ) |
|
17 | + static function match($str, $regex) |
|
18 | 18 | { |
19 | 19 | return preg_match($regex, $str) === 1; |
20 | 20 | } |
21 | 21 | |
22 | - static function is_email( $str ) |
|
22 | + static function is_email($str) |
|
23 | 23 | { |
24 | - return \is_email( $str ) !== false; |
|
24 | + return \is_email($str) !== false; |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -4,34 +4,34 @@ |
||
4 | 4 | |
5 | 5 | class Number |
6 | 6 | { |
7 | - static function is_numeric( $num ) |
|
7 | + static function is_numeric($num) |
|
8 | 8 | { |
9 | 9 | return \is_numeric($num); |
10 | 10 | } |
11 | 11 | |
12 | - static function is_int( $num ) |
|
12 | + static function is_int($num) |
|
13 | 13 | { |
14 | 14 | return \is_int($num); |
15 | 15 | } |
16 | 16 | |
17 | - static function is_float( $num ) |
|
17 | + static function is_float($num) |
|
18 | 18 | { |
19 | 19 | return \is_float($num); |
20 | 20 | } |
21 | 21 | |
22 | - static function less_than( $num, $limit ) |
|
22 | + static function less_than($num, $limit) |
|
23 | 23 | { |
24 | 24 | return self::is_numeric($num) && $num < $limit; |
25 | 25 | } |
26 | 26 | |
27 | - static function greater_than( $num, $limit ) |
|
27 | + static function greater_than($num, $limit) |
|
28 | 28 | { |
29 | 29 | return self::is_numeric($num) && $num > $limit; |
30 | 30 | } |
31 | 31 | |
32 | - static function in_range( $num, $min, $max, $inclusive = false ) |
|
32 | + static function in_range($num, $min, $max, $inclusive = false) |
|
33 | 33 | { |
34 | - if($inclusive) |
|
34 | + if ($inclusive) |
|
35 | 35 | { |
36 | 36 | return self::is_numeric($num) && $num <= $max && $num >= $min; |
37 | 37 | } |
@@ -6,13 +6,13 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | // Prevent direct file access |
9 | -defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
|
9 | +defined('ABSPATH') or die('No script kiddies please!'); |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Load module functions. If this amarkal module has not been loaded, |
13 | 13 | * functions.php will not return false. |
14 | 14 | */ |
15 | -if(false !== (require_once 'functions.php')) |
|
15 | +if (false !== (require_once 'functions.php')) |
|
16 | 16 | { |
17 | 17 | // Load required classes if not using composer |
18 | 18 | require_once 'Strings.php'; |