Skip to content

Commit

Permalink
Make attributes case configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1n0 committed Feb 9, 2017
1 parent 92ae224 commit 1e537e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Transformer/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit 1e537e8

Please sign in to comment.