Skip to content

Commit

Permalink
Renaming Expander to YamlExpander. (#17)
Browse files Browse the repository at this point in the history
Renaming Expander to YamlExpander.
  • Loading branch information
grasmash authored Aug 17, 2019
2 parents db59cd1 + 2af0e21 commit 6ab3120
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
11 changes: 5 additions & 6 deletions src/Expander.php → src/YamlExpander.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
namespace Grasmash\YamlExpander;

use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\Yaml\Yaml;
use Grasmash\Expander\Expander as GrasmashExpander;
use Grasmash\Expander\Expander;

/**
* Class Expander
* Class YamlExpander
* @package Grasmash\YamlExpander
*/
class Expander
class YamlExpander
{
/**
* @var \Psr\Log\LoggerInterface
Expand All @@ -24,14 +23,14 @@ class Expander
protected $expander;

/**
* Expander constructor.
* YamlExpander constructor.
*
* @param \Psr\Log\LoggerInterface $logger
*/
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
$this->expander = new GrasmashExpander();
$this->expander = new Expander();
$this->expander->setLogger($logger);
$this->expander->setStringifier(new Stringifier());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
namespace Grasmash\YamlExpander\Tests\Command;

use Dflydev\DotAccessData\Data;
use Grasmash\YamlExpander\Expander;
use Grasmash\YamlExpander\YamlExpander;
use Grasmash\YamlExpander\Stringifier;
use Grasmash\YamlExpander\Tests\TestBase;
use Psr\Log\NullLogger;
use Symfony\Component\Yaml\Yaml;

class ExpanderTest extends \PHPUnit_Framework_TestCase
class YamlExpanderTest extends \PHPUnit_Framework_TestCase
{

/**
* Tests Expander::expandArrayProperties().
* Tests YamlExpander::expandArrayProperties().
*
* @param string $filename
* @param array $reference_array
Expand All @@ -24,7 +24,7 @@ public function testExpandArrayProperties($filename, $reference_array)
{
$array = Yaml::parse(file_get_contents(__DIR__ . "/../resources/$filename"));
putenv("test=gomjabbar");
$expander = new Expander(new NullLogger());
$expander = new YamlExpander(new NullLogger());
$expanded = $expander->expandArrayProperties($array);
$this->assertEquals('gomjabbar', $expanded['env-test']);
$this->assertEquals('Frank Herbert 1965', $expanded['book']['copyright']);
Expand All @@ -40,7 +40,7 @@ public function testExpandArrayProperties($filename, $reference_array)
}

/**
* Tests Expander::parse().
* Tests YamlExpander::parse().
*
* @param string $filename
* @param array $reference_array
Expand All @@ -50,7 +50,7 @@ public function testExpandArrayProperties($filename, $reference_array)
public function testParse($filename, $reference_array)
{
$yaml_string = file_get_contents(__DIR__ . "/../resources/$filename");
$expander = new Expander(new NullLogger());
$expander = new YamlExpander(new NullLogger());
$expanded = $expander->parse($yaml_string);
$this->assertEquals('Frank Herbert 1965', $expanded['book']['copyright']);
$this->assertEquals('Paul Atreides', $expanded['book']['protaganist']);
Expand Down Expand Up @@ -78,7 +78,7 @@ public function providerYaml()
}

/**
* Tests Expander::expandProperty().
* Tests YamlExpander::expandProperty().
*/
public function testStringifyArray()
{
Expand Down

0 comments on commit 6ab3120

Please sign in to comment.