/**
  * Definition constructor.
  * @param Glossary $glossary
  * @param string $name
  * @param string $references
  */
 public function __construct(Glossary $glossary, $name, $references)
 {
     parent::__construct($glossary, $name);
     $this->references = $references;
 }
Exemplo n.º 2
0
 /**
  * Copies images of a definition to the wiki.
  *
  * @param Definition $definition
  */
 private function copyImages(Definition $definition)
 {
     $dir = __DIR__ . '/../img/';
     foreach ($definition->getImages() as $image) {
         copy($dir . $image . '.png', $this->directory . '/img/' . $image . '.png');
     }
 }
Exemplo n.º 3
0
 /**
  * @param string $line
  * @param Definition $definition
  * @return string
  */
 private function writeDefinition($line, Definition $definition)
 {
     $name = $definition->getName();
     $line .= $name . ': ';
     $annotations = array_merge($definition->getPrefix() ? [$definition->getPrefix()] : [], $this->formatTags($definition), $this->formatImages($definition));
     $line .= implode(' ', $annotations);
     $line .= $definition->toString();
     $line .= "\n";
     return $line;
 }