public getAttribute ( string $key ) : mixed | ||
$key | string | The key of the value to return |
return | mixed | The value stored in the initial context |
public function getAttribute($key)
{
return $this->storage->get($key);
}
/** * Tests the if the attribute getter/setter works with a object. * * @return void */ public function testGetSetAttributeWithObject() { $stdClass = new \stdClass(); $stdClass->test = 'Testvalue'; $this->initialContext->setAttribute('stdClass', $stdClass); $this->assertEquals($stdClass->test, $this->initialContext->getAttribute('stdClass')->test); }