From 18531d0348e9bbe32f5dd05a72f3e7aa4c362c59 Mon Sep 17 00:00:00 2001 From: automatix Date: Tue, 24 Apr 2018 22:54:25 +0200 Subject: [PATCH] #5 The Symfony Serializer Component added. `composer require symfony/serializer` --- composer.json | 1 + config/dependencies/common.php | 3 +++ src/Base/Utils/CamelCaseToSnakeCaseNameConverter.php | 10 ++++++++++ src/Base/Utils/NameConverterInterface.php | 10 ++++++++++ symfony.lock | 3 +++ 5 files changed, 27 insertions(+) create mode 100644 src/Base/Utils/CamelCaseToSnakeCaseNameConverter.php create mode 100644 src/Base/Utils/NameConverterInterface.php diff --git a/composer.json b/composer.json index 63dbae5..05fd323 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ "symfony/framework-bundle": "^4.0", "symfony/lts": "^4@dev", "symfony/orm-pack": "^1.0", + "symfony/serializer": "^4.0", "symfony/twig-bundle": "^4.0", "symfony/yaml": "^4.0" }, diff --git a/config/dependencies/common.php b/config/dependencies/common.php index 24adb07..c98e7a8 100644 --- a/config/dependencies/common.php +++ b/config/dependencies/common.php @@ -1,5 +1,7 @@ DI\autowire(FooBService::class), BarServiceInterface::class => DI\autowire(BarService::class), + NameConverterInterface::class => DI\autowire(CamelCaseToSnakeCaseNameConverter::class), EntityManagerInterface::class => function () { $config = new Configuration(); $config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader())); diff --git a/src/Base/Utils/CamelCaseToSnakeCaseNameConverter.php b/src/Base/Utils/CamelCaseToSnakeCaseNameConverter.php new file mode 100644 index 0000000..064ae5a --- /dev/null +++ b/src/Base/Utils/CamelCaseToSnakeCaseNameConverter.php @@ -0,0 +1,10 @@ +