/** * This one will populate the map indexed by annotations names, so we can * then get all classes with a particular annotation name. * * @param string $class A class name. * @param Collection $annotations The annotations to index. * * @return void */ private function _populateClassesPerAnnotations($class, Collection $annotations) { foreach ($annotations->getAll() as $name => $annotation) { $cacheKey = $name . '.classbyannotations'; if (!isset($this->_classesAnnotated[$name])) { $this->_classesAnnotated[$name] = array(); } $this->_classesAnnotated[$name][$class] = $class; $this->_cache->store($cacheKey, $this->_classesAnnotated); } }