Nelmio\Alice\Generator\GenerationContext::cacheValue PHP Method

cacheValue() public method

public cacheValue ( string $key, $value )
$key string
    public function cacheValue(string $key, $value)
    {
        $this->cache[$key] = $value;
    }

Usage Example

Example #1
0
 public function testCanSetAnRetrieveAValueFromTheCache()
 {
     $context = new GenerationContext();
     $context->cacheValue('foo', $foo = new \stdClass());
     $this->assertSame($foo, $context->getCachedValue('foo'));
 }
All Usage Examples Of Nelmio\Alice\Generator\GenerationContext::cacheValue