diff options
author | Valentin Popov <info@valentineus.link> | 2020-07-15 15:59:38 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2020-07-15 16:03:27 +0300 |
commit | 5062d35a0d3a6463ef03c8f83fe2f93ac9099a62 (patch) | |
tree | 39d00300efbf1b5bfe66e616dc0575a456f4e525 /src/Parsers/StringParser.php | |
parent | 9682cb058c468329a3273607d2fcb172fdfd9835 (diff) | |
download | php-epg-service-5062d35a0d3a6463ef03c8f83fe2f93ac9099a62.tar.xz php-epg-service-5062d35a0d3a6463ef03c8f83fe2f93ac9099a62.zip |
Updated parsers
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'src/Parsers/StringParser.php')
-rw-r--r-- | src/Parsers/StringParser.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Parsers/StringParser.php b/src/Parsers/StringParser.php index 1bc7a60..c22d8f1 100644 --- a/src/Parsers/StringParser.php +++ b/src/Parsers/StringParser.php @@ -19,8 +19,6 @@ declare(strict_types = 1); namespace EPGService\Parsers; -use function is_string; - /** * @copyright Copyright © 2020 “Valentin Popov” <info@valentineus.link> * @license http://www.apache.org/licenses/LICENSE-2.0 @@ -30,11 +28,9 @@ final class StringParser { /** * @param $value * - * @return string|null + * @return string */ - public static function get($value): ?string { - $result = filter_var($value, FILTER_SANITIZE_STRING, FILTER_NULL_ON_FAILURE); - - return is_string($result) ? trim($result) : null; + public static function get($value): string { + return filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW); } } |