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

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

Get resource
public getResource ( $key ) : string
$key
Результат string
    public function getResource($key)
    {
        $resources = $this->getResources();
        if (!isset($resources[$key])) {
            throw new ResourceNotFoundException("Resource '{$key}' not found in stack '{$this->getName()}'");
        }
        return $resources[$key];
    }

Usage Example

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