src/Filter/Booleans.php 1 location
|
@@ 46-48 (lines=3) @@
|
43 |
|
return $value; |
44 |
|
} |
45 |
|
|
46 |
|
if (!is_string($value)) { |
47 |
|
throw new Exception('"' . var_export($value, true) . '" $value is not a string'); |
48 |
|
} |
49 |
|
|
50 |
|
$value = trim($value); |
51 |
|
|
src/Filter/Email.php 1 location
|
@@ 23-25 (lines=3) @@
|
20 |
|
*/ |
21 |
|
public static function filter($value) |
22 |
|
{ |
23 |
|
if (!is_string($value)) { |
24 |
|
throw new Exception("Value '" . var_export($value, true) . "' is not a string"); |
25 |
|
} |
26 |
|
|
27 |
|
$filteredEmail = filter_var($value, FILTER_VALIDATE_EMAIL); |
28 |
|
if ($filteredEmail === false) { |
src/Filter/Strings.php 2 locations
|
@@ 53-55 (lines=3) @@
|
50 |
|
$value = (string)$value; |
51 |
|
} |
52 |
|
|
53 |
|
if (!is_string($value)) { |
54 |
|
throw new Exception("Value '" . var_export($value, true) . "' is not a string"); |
55 |
|
} |
56 |
|
|
57 |
|
$valueLength = strlen($value); |
58 |
|
|
|
@@ 88-90 (lines=3) @@
|
85 |
|
*/ |
86 |
|
public static function explode($value, $delimiter = ',') |
87 |
|
{ |
88 |
|
if (!is_string($value)) { |
89 |
|
throw new Exception("Value '" . var_export($value, true) . "' is not a string"); |
90 |
|
} |
91 |
|
|
92 |
|
if (!is_string($delimiter) || empty($delimiter)) { |
93 |
|
throw new \InvalidArgumentException( |
src/Filter/Url.php 1 location
|
@@ 36-38 (lines=3) @@
|
33 |
|
return null; |
34 |
|
} |
35 |
|
|
36 |
|
if (!is_string($value)) { |
37 |
|
throw new Exception("Value '" . var_export($value, true) . "' is not a string"); |
38 |
|
} |
39 |
|
|
40 |
|
$filteredUrl = filter_var($value, FILTER_VALIDATE_URL); |
41 |
|
if ($filteredUrl === false) { |