Skip to content

Commit

Permalink
Make config property private again, add a final getSettings() metho…
Browse files Browse the repository at this point in the history
…d to Mutator class
  • Loading branch information
maks-rafalko committed Jan 11, 2019
1 parent 9d19360 commit 772d762
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Mutator/Boolean/TrueValue.php
Expand Up @@ -77,7 +77,7 @@ protected function mutatesNode(Node $node): bool
return true;
}

$resultSettings = array_merge(self::DEFAULT_SETTINGS, $this->config->getMutatorSettings());
$resultSettings = array_merge(self::DEFAULT_SETTINGS, $this->getSettings());

$functionName = $grandParentNode->name->toLowerString();

Expand Down
7 changes: 6 additions & 1 deletion src/Mutator/Util/Mutator.php
Expand Up @@ -43,7 +43,7 @@ abstract class Mutator
/**
* @var MutatorConfig
*/
protected $config;
private $config;

public function __construct(MutatorConfig $config)
{
Expand Down Expand Up @@ -77,5 +77,10 @@ final public static function getName(): string
return end($parts);
}

final protected function getSettings(): array
{
return $this->config->getMutatorSettings();
}

abstract protected function mutatesNode(Node $node): bool;
}

0 comments on commit 772d762

Please sign in to comment.