public function getFactoryClass($file)
 {
     $name = $this->getFactoryClassName($file);
     if ($name !== null) {
         require_once $file;
         if (class_exists($name)) {
             $class = new FactoryClass(substr($file, strpos($file, 'Hamcrest/')), new ReflectionClass($name));
             if ($class->isFactory()) {
                 return $class;
             }
         }
     }
     return null;
 }
 /**
  * Gets the 'new_factory_service' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \FooBarBaz A FooBarBaz instance
  */
 protected function getNewFactoryServiceService()
 {
     $a = new \FactoryClass();
     $a->foo = 'bar';
     $this->services['new_factory_service'] = $instance = $a->getInstance();
     $instance->foo = 'bar';
     return $instance;
 }
 public function getClassName()
 {
     return $this->class->getName();
 }