From a59d803d96d7feece0e7d57ce663c6e93ac828cb Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sat, 26 Jan 2019 17:06:29 +0100 Subject: [PATCH] Implemented LayerClassMap --- .../Domain/LayerManagement/LayerClassMap.php | 32 +++++++++++++++++++ .../LayerClassMapInterface.php | 16 ++++++++++ 2 files changed, 48 insertions(+) create mode 100644 application/symfony/src/Domain/LayerManagement/LayerClassMap.php create mode 100644 application/symfony/src/Domain/LayerManagement/LayerClassMapInterface.php diff --git a/application/symfony/src/Domain/LayerManagement/LayerClassMap.php b/application/symfony/src/Domain/LayerManagement/LayerClassMap.php new file mode 100644 index 0000000..b8dac3f --- /dev/null +++ b/application/symfony/src/Domain/LayerManagement/LayerClassMap.php @@ -0,0 +1,32 @@ + AbstractSource::class, + ]; + + /** + * @param string $layer + * + * @throws NotSetException + * + * @return string + */ + public static function getClass(string $layer): string + { + if (array_key_exists($layer, self::LAYER_CLASS_MAP)) { + return self::LAYER_CLASS_MAP[$layer]; + } + throw new NotSetException('The requested layer is not mapped!'); + } +} diff --git a/application/symfony/src/Domain/LayerManagement/LayerClassMapInterface.php b/application/symfony/src/Domain/LayerManagement/LayerClassMapInterface.php new file mode 100644 index 0000000..583e34a --- /dev/null +++ b/application/symfony/src/Domain/LayerManagement/LayerClassMapInterface.php @@ -0,0 +1,16 @@ +