Skip to content

Commit

Permalink
Rename InjectConfigForCommand and ApplyConfig to ConfigForCommand and…
Browse files Browse the repository at this point in the history
… ConfigForSetters, respectively, ane move them to the Consolidation\Config\Inject namespace.
  • Loading branch information
greg-1-anderson committed Jun 28, 2017
1 parent 5c7a3f1 commit 4f1c569
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Then you can fetch the value of the configuration option `c` via:
```
$value = $config->get('a.b.c');
```
[dflydev/dot-access-data](https://github.com/dflydev/dot-access-data) is levereaged to provide this capability.
[dflydev/dot-access-data](https://github.com/dflydev/dot-access-data) is leveraged to provide this capability.

## External Examples

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Consolidation\Config\Command;
namespace Consolidation\Config\Inject;

use Consolidation\Config\ConfigInterface;
use Consolidation\Config\Util\ConfigFallback;
Expand All @@ -8,7 +8,7 @@
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class InjectConfigForCommand implements EventSubscriberInterface
class ConfigForCommand implements EventSubscriberInterface
{
protected $config;

Expand Down
6 changes: 4 additions & 2 deletions src/Util/ApplyConfig.php → src/Inject/ConfigForSetters.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
namespace Consolidation\Config\Util;
namespace Consolidation\Config\Inject;

use Consolidation\Config\Util\ConfigMerge;

/**
* Given an object that contains configuration methods, inject any
Expand All @@ -9,7 +11,7 @@
* provided object. Using configuration to call methods that do work
* is an abuse of this mechanism.
*/
class ApplyConfig
class ConfigForSetters
{
protected $config;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
namespace Consolidation\Config\Command;
namespace Consolidation\Config\Inject;

use Consolidation\Config\Config;
use Consolidation\TestUtils\MyFooCommand;
Expand All @@ -11,7 +11,7 @@
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;

class InjectConfigForCommandTest extends \PHPUnit_Framework_TestCase
class ConfigForCommandTest extends \PHPUnit_Framework_TestCase
{
protected $config;

Expand Down Expand Up @@ -78,7 +78,7 @@ public function testInjectionWithOverride()

protected function runCommandViaApplication($command, $input)
{
$configInjector = new InjectConfigForCommand($this->config);
$configInjector = new ConfigForCommand($this->config);

$output = new BufferedOutput();
$application = new Application('TestApplication', '0.0.0');
Expand Down
8 changes: 4 additions & 4 deletions tests/ApplyConfigTest.php → tests/ConfigForSettersTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
namespace Consolidation\Config\Util;
namespace Consolidation\Config\Inject;

use Consolidation\Config\Config;
use Consolidation\TestUtils\ApplyConfigTestTarget;

class ApplyConfigTest extends \PHPUnit_Framework_TestCase
class ConfigForSettersTest extends \PHPUnit_Framework_TestCase
{
public function testApplyConfig()
{
Expand All @@ -30,7 +30,7 @@ public function testApplyConfig()
];
$config = new Config($data);

$applicator = new ApplyConfig($config, 'Operations.Frobulate', 'task.');
$applicator = new ConfigForSetters($config, 'Operations.Frobulate', 'task.');

$testTarget = new ApplyConfigTestTarget();

Expand Down Expand Up @@ -64,7 +64,7 @@ public function testApplyBadConfig()
];
$config = new Config($data);

$applicator = new ApplyConfig($config, 'Operations.Frobulate', 'task.');
$applicator = new ConfigForSetters($config, 'Operations.Frobulate', 'task.');

$testTarget = new ApplyConfigTestTarget();

Expand Down

0 comments on commit 4f1c569

Please sign in to comment.