addGeneratedType() публичный Метод

public addGeneratedType ( string $type )
$type string
Пример #1
0
 /**
  * @param Resource $resource
  * @param array             $data
  */
 public function generate(Resource $resource, array $data = array())
 {
     $filepath = $this->getFilePath($resource);
     if ($this->fileAlreadyExists($filepath)) {
         if ($this->userAborts($filepath)) {
             return;
         }
         $this->io->writeln();
     }
     $this->createDirectoryIfItDoesExist($filepath);
     $this->generateFileAndRenderTemplate($resource, $filepath);
     $this->executionContext->addGeneratedType($resource->getSrcClassname());
 }
Пример #2
0
 function it_records_that_class_was_created_in_executioncontext(Resource $resource, ExecutionContext $executionContext)
 {
     $resource->getName()->willReturn('App');
     $resource->getSrcFilename()->willReturn('/project/src/Acme/App.php');
     $resource->getSrcNamespace()->willReturn('Acme');
     $resource->getSrcClassname()->willReturn('Acme\\App');
     $this->generate($resource);
     $executionContext->addGeneratedType('Acme\\App')->shouldHaveBeenCalled();
 }