/**
  * Do some stuff on file
  *
  * @param array $configuration
  * @param FileContainer $fileContainer
  * @throws \Exception
  */
 public function generate(array $configuration, FileContainer $fileContainer)
 {
     $this->configuration = $configuration;
     foreach ($configuration['entities'] as $entityName => $config) {
         $fqcn = $this->createEntityFqcn($this->configuration, $entityName);
         $entityFile = new ClassFileDefinition($entityName, $config, $fqcn);
         // Parent
         if (null !== $config['parent']) {
             if (false === array_key_exists($config['parent'], $this->configuration['entities'])) {
                 throw new \Exception(sprintf('Entity %s has for parent %s, but this entity is not defined in config file', $entityName, $config['parent']));
             }
             $entityFile->setParent($this->createEntityFqcn($this->configuration, $config['parent']));
         }
         // Abstract
         if (true === $config['abstract']) {
             $entityFile->setPrefix(ClassPrefix::ABSTRACT_PREFIX());
         }
         //Properties
         $construct = $this->getConstructor($entityFile);
         foreach ($config['properties'] as $propertyName => $propertyConfig) {
             $property = $this->createProperty($propertyName, $propertyConfig);
             $property->setVisibility(new Visibility($this->configuration['global']['fieldVisibility']));
             $entityFile->addProperty($property);
             if ($property->getDefaultValue() instanceof ObjectValue) {
                 $construct->addLine(sprintf('$this->%s = %s;', $property->getName()->toLowerCamelCase(), $property->getDefaultValue()->getPhpFormatedValue()));
             }
         }
         if (0 !== count($construct->getLines())) {
             $entityFile->addMethod($construct);
         }
         //Create
         $fileContainer->addFile($entityFile, [Tag::ENTITY()]);
     }
 }
 /**
  * Do some stuff on file.
  *
  * @param array         $configuration
  * @param FileContainer $fileContainer
  *
  * @return void
  */
 public function generate(array $configuration, FileContainer $fileContainer)
 {
     foreach ($configuration['enums'] as $enumName => $enumConfiguration) {
         $fqcn = $this->createEnumFqcn($configuration, $enumName);
         $file = new ClassFileDefinition($enumName, $enumConfiguration, $fqcn);
         $file->setParent(new FullyQualifiedClassName('MyCLabs\\Enum\\Enum'));
         $file->setPrefix(ClassPrefix::FINAL_PREFIX());
         foreach ($enumConfiguration['items'] as $item) {
             $file->addConstant(new ConstantDefinition(new PhpVariableName($item), new StringValue($item)));
         }
         $fileContainer->addFile($file, [Tag::ENUM]);
     }
 }