コード例 #1
0
 /**
  * @param CertificationContextInterface $context
  *
  * @return Certification
  */
 public function build(CertificationContextInterface $context)
 {
     if ($this->collector->isDirty()) {
         $this->collector->release();
     }
     if (null !== $this->logger) {
         $this->logger->debug(sprintf('Build certification %s', $context->getName()));
     }
     $oid = md5(serialize($context));
     //It's not based of object instance, but on his content.
     if (!isset($this->cache[$oid])) {
         foreach ($this->builderPass as $pass) {
             $pass->setCollector($this->collector);
             $pass->execute($this, $context);
         }
         $this->cache[$oid] = $this->normalize($context);
     }
     return $this->cache[$oid];
 }