From 1e537e8d4dd5f92f61933259f48251ff80398bf1 Mon Sep 17 00:00:00 2001 From: m1n0 Date: Thu, 9 Feb 2017 20:14:45 +0100 Subject: [PATCH] Make attributes case configurable. --- src/Transformer/Transformer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Transformer/Transformer.php b/src/Transformer/Transformer.php index 3bf7915..183eba4 100644 --- a/src/Transformer/Transformer.php +++ b/src/Transformer/Transformer.php @@ -21,6 +21,8 @@ abstract class Transformer implements StrategyInterface /** @var Mapping[] */ protected $mappings; /** @var string */ + protected $attributesCase; + /** @var string */ protected $firstUrl; /** @var string */ protected $lastUrl; @@ -35,10 +37,12 @@ abstract class Transformer implements StrategyInterface /** * @param Mapper $mapper + * @param string $attributesCase */ - public function __construct(Mapper $mapper) + public function __construct(Mapper $mapper, string $attributesCase = 'snake_case') { $this->mappings = $mapper->getClassMap(); + $this->attributesCase = $attributesCase; } /**