for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Borobudur-Kernel package.
*
* (c) Hexacodelabs <http://hexacodelabs.com>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Borobudur\Kernel;
use Borobudur\Kernel\Exception\RuntimeException;
/**
* @author Iqbal Maulana <[email protected]>
* @created 8/17/15
class EnvironmentManager
{
* @var string
private $env;
* @var EnvironmentInterface
private $envInstance;
* Constructor.
* @param string $env
public function __construct($env)
$this->env = $env;
}
* Set environment.
public function setEnv($env)
* Get env.
* @return string
public function getEnv()
return $this->env;
* Set active env instance.
* @param EnvironmentInterface $env
public function setEnvInstance(EnvironmentInterface $env)
$this->envInstance = $env;
* Get environment instance.
* @return EnvironmentInterface
public function getEnvInstance()
if (null === $this->envInstance) {
throw new RuntimeException('There are no active environment.');
return $this->envInstance;