StackFormation\Stack::getParameter PHP Метод

getParameter() публичный Метод

public getParameter ( $key )
    public function getParameter($key)
    {
        $parameters = $this->getParameters();
        if (!isset($parameters[$key])) {
            throw new ParameterNotFoundException("Parameter '{$key}' not found in stack '{$this->getName()}'");
        }
        if ($parameters[$key] == '****') {
            throw new \Exception("Trying to retrieve a 'NoEcho' value (Key: '{$key}')");
        }
        return $parameters[$key];
    }

Usage Example

Пример #1
0
 public function testParameterThatDoesntExist()
 {
     $this->setExpectedException('Exception', "Parameter 'DoesNotExist' not found in stack 'test-stack1'");
     $this->stack->getParameter('DoesNotExist');
 }