Skip to content

Commit 0a9b953

Browse files
authored
Merge pull request #13 from m1n0/configurable-attributes-case
Make attributes case configurable.
2 parents 6759043 + 1e537e8 commit 0a9b953

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Transformer/Transformer.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ abstract class Transformer implements StrategyInterface
2121
/** @var Mapping[] */
2222
protected $mappings;
2323
/** @var string */
24+
protected $attributesCase;
25+
/** @var string */
2426
protected $firstUrl;
2527
/** @var string */
2628
protected $lastUrl;
@@ -35,10 +37,12 @@ abstract class Transformer implements StrategyInterface
3537

3638
/**
3739
* @param Mapper $mapper
40+
* @param string $attributesCase
3841
*/
39-
public function __construct(Mapper $mapper)
42+
public function __construct(Mapper $mapper, string $attributesCase = 'snake_case')
4043
{
4144
$this->mappings = $mapper->getClassMap();
45+
$this->attributesCase = $attributesCase;
4246
}
4347

4448
/**

0 commit comments

Comments
 (0)