/**
  * Index build method.
  *
  * Its responsibility is to call the parseFile
  * and generate methods from generator.
  */
 public function build()
 {
     $files = $this->iterator->getFiles();
     $generators = $this->generatorRegistry->generators();
     foreach ($files as $file) {
         foreach ($generators as $generator) {
             $generator->parseFile($file);
         }
     }
     foreach ($generators as $generator) {
         $generator->generate();
     }
 }
 function it_builds(IteratorInterface $iterator, FileInterface $file, GeneratorRegistry $generatorRegistry, GeneratorInterface $generator)
 {
     $iterator->getFiles()->shouldBeCalled()->willReturn([$file]);
     $generatorRegistry->generators()->shouldBeCalled()->willReturn([$generator]);
     $this->build();
 }