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

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

Get output
public getOutput ( $key ) : string
$key
Результат string
    public function getOutput($key)
    {
        $outputs = $this->getOutputs();
        if (!isset($outputs[$key])) {
            throw new OutputNotFoundException("Output '{$key}' not found in stack '{$this->getName()}'");
        }
        if ($outputs[$key] == '****') {
            throw new \Exception("Trying to retrieve a 'NoEcho' value (Key: '{$key}')");
        }
        return $outputs[$key];
    }

Usage Example

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