Skip to content

Commit

Permalink
Revert "remove NamedModule"
Browse files Browse the repository at this point in the history
This reverts commit 37dd830.
  • Loading branch information
koriym committed Mar 22, 2015
1 parent 37dd830 commit 69a930f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/Module/Constant/NamedModule.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* This file is part of the BEAR.Sunday package
*
* @license http://opensource.org/licenses/bsd-license.php BSD
*/
namespace BEAR\Sunday\Module\Constant;

use Ray\Di\AbstractModule;

class NamedModule extends AbstractModule
{
/**
* @var array
*/
private $names;

/**
* @param array $names
*/
public function __construct(array $names)
{
$this->names = $names;
parent::__construct();
}

/**
* {@inheritdoc}
*/
protected function configure()
{
foreach ($this->names as $annotatedWith => $instance) {
$this->bind()->annotatedWith($annotatedWith)->toInstance($instance);
}
}
}

0 comments on commit 69a930f

Please sign in to comment.