-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 37dd830.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |