From c0d5496035e5ac7ec44a832428a8d651a950903d Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 15 Jul 2020 19:13:16 +0400 Subject: Added interface of parser Signed-off-by: Valentin Popov --- src/Parsers/BaseParser.php | 34 ++++++++++++++++++++++++++++++++++ src/Parsers/IntegerParser.php | 2 +- src/Parsers/StringParser.php | 2 +- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/Parsers/BaseParser.php diff --git a/src/Parsers/BaseParser.php b/src/Parsers/BaseParser.php new file mode 100644 index 0000000..d36508d --- /dev/null +++ b/src/Parsers/BaseParser.php @@ -0,0 +1,34 @@ + + * @license http://www.apache.org/licenses/LICENSE-2.0 + * @package EPGService\Parsers + */ +interface BaseParser { + /** + * @param mixed $value + * + * @return mixed + */ + public static function get($value); +} diff --git a/src/Parsers/IntegerParser.php b/src/Parsers/IntegerParser.php index 3eb4ea1..ba89315 100644 --- a/src/Parsers/IntegerParser.php +++ b/src/Parsers/IntegerParser.php @@ -24,7 +24,7 @@ namespace EPGService\Parsers; * @license http://www.apache.org/licenses/LICENSE-2.0 * @package EPGService\Parsers */ -final class IntegerParser { +final class IntegerParser implements BaseParser { /** * @param mixed $value * diff --git a/src/Parsers/StringParser.php b/src/Parsers/StringParser.php index c22d8f1..8473106 100644 --- a/src/Parsers/StringParser.php +++ b/src/Parsers/StringParser.php @@ -24,7 +24,7 @@ namespace EPGService\Parsers; * @license http://www.apache.org/licenses/LICENSE-2.0 * @package EPGService\Parsers */ -final class StringParser { +final class StringParser implements BaseParser { /** * @param $value * -- cgit v1.2.3