/**
  * {@inheritDoc}
  */
 public function generateCode($model, array $parameters = array())
 {
     $fqcn = get_class($model);
     $name = FullyQualifiedName::make($fqcn)->getName();
     $modelName = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $name));
     $parameters[$modelName] = $model;
     return $this->templateEngine->render('phpdoc/' . $modelName, $parameters);
 }
 function it_generates_code_using_collection_templates(TemplateEngine $templateEngine)
 {
     $argument = new Argument('string', 'filename');
     $arguments = array($argument);
     $templateEngine->render('collection/argument_collection', array('argument_collection' => $arguments))->shouldBeCalled();
     $this->generateCode($arguments);
 }
 function it_generates_code_using_collection_templates(TemplateEngine $templateEngine)
 {
     $parameterTag = new ParameterTag('string', 'filename');
     $parameterTags = array($parameterTag);
     $templateEngine->render('collection/phpdoc/parameter_tag_collection', array('parameter_tag_collection' => $parameterTags))->shouldBeCalled();
     $this->generateCode($parameterTags);
 }
 function it_generates_code_using_phpdoc_templates(TemplateEngine $templateEngine)
 {
     $licensePhpdoc = new LicensePhpdoc('Memio', 'author', '*****@*****.**');
     $templateEngine->render('phpdoc/license_phpdoc', array('license_phpdoc' => $licensePhpdoc))->shouldBeCalled();
     $this->generateCode($licensePhpdoc);
 }
 function it_handles_collections(TemplateEngine $templateEngine)
 {
     $collection = array(new Argument('bool', 'isObject'));
     $templateEngine->render('collection/argument_collection', array('argument_collection' => $collection))->shouldBeCalled();
     $this->generateCode($collection);
 }