/** * testCreateReturnsDifferentInstancesForDifferentCacheNames * * @return void */ public function testCreateReturnsDifferentInstancesForDifferentCacheNames() { $factory = new CacheFactory($this->createConfigurationFixture()); $cache0 = $factory->create(); $cache1 = $factory->create(__FUNCTION__); $this->assertNotSame($cache0, $cache1); }
private function createAnalyzers($options) { $analyzers = $this->analyzerFactory->createRequiredForGenerators($this->generators); $cacheKey = md5(serialize($this->files) . serialize($this->directories)); $cache = $this->cacheFactory->create($cacheKey); foreach ($analyzers as $analyzer) { if ($analyzer instanceof AnalyzerCacheAware) { $analyzer->setCache($cache); } $analyzer->setOptions($options); foreach ($this->listeners as $listener) { $analyzer->addAnalyzeListener($listener); if ($analyzer instanceof ASTVisitor) { $analyzer->addVisitListener($listener); } } } return $analyzers; }