/**
  * {@inheritDoc}
  */
 public function load($resource, $type = null)
 {
     $file = $this->locator->locate($resource, $type);
     if ($this->collector) {
         $this->collector->addResource(new FileResource($file));
     }
     $data = $this->doLoad($file);
     return $this->process($data, $resource);
 }