コード例 #1
0
 /**
  * @inheritdoc
  */
 public function resolve(CollectorInterface $collector)
 {
     $resources = array();
     foreach ($collector->collect() as $resourceName => $requirement) {
         $resolvedName = $requirement->getResolvedName();
         if ($this->provider->has($resourceName)) {
             $resource = $this->provider->get($resourceName);
             $resources[$resolvedName] = $resource;
         } elseif (!$requirement->isOptional()) {
             throw new ResourceNotFoundException(sprintf('Cannot resolve resource with name %s', $resourceName));
         }
     }
     return $resources;
 }
コード例 #2
0
 /**
  * @inheritdoc
  */
 public function collect()
 {
     return $this->collector->collect();
 }