Skip to content

Commit

Permalink
Merge pull request #13 from m1n0/configurable-attributes-case
Browse files Browse the repository at this point in the history
Make attributes case configurable.
  • Loading branch information
nilportugues committed Mar 13, 2017
2 parents 6759043 + 1e537e8 commit 0a9b953
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 0a9b953

Please sign in to comment.