src/Filter/Booleans.php 1 location
|
@@ 41-43 (lines=3) @@
|
| 38 |
|
return $value; |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
if (!is_string($value)) { |
| 42 |
|
throw new Exception('"' . var_export($value, true) . '" $value is not a string'); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
$value = trim($value); |
| 46 |
|
|
src/Filter/Email.php 1 location
|
@@ 23-25 (lines=3) @@
|
| 20 |
|
*/ |
| 21 |
|
public static function filter($value) : string |
| 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/Url.php 1 location
|
@@ 32-34 (lines=3) @@
|
| 29 |
|
return null; |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
if (!is_string($value)) { |
| 33 |
|
throw new Exception("Value '" . var_export($value, true) . "' is not a string"); |
| 34 |
|
} |
| 35 |
|
|
| 36 |
|
$filteredUrl = filter_var($value, FILTER_VALIDATE_URL); |
| 37 |
|
if ($filteredUrl === false) { |