Commit a6e19bcf authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

WritableInterface::outputTo renommée en WritableInterface::writeTo.

Et de même pour toutes les méthodes write*To.
parent 1c471ae3
...@@ -115,7 +115,7 @@ class GenerateCommand extends ContainerAwareCommand ...@@ -115,7 +115,7 @@ class GenerateCommand extends ContainerAwareCommand
$graph->visitAll(); $graph->visitAll();
$writer = new OutputWriter($output); $writer = new OutputWriter($output);
$graph->outputTo($writer); $graph->writeTo($writer);
} }
/** /**
......
...@@ -42,17 +42,17 @@ class BaseArrow implements ArrowInterface ...@@ -42,17 +42,17 @@ class BaseArrow implements ArrowInterface
$this->label = $label; $this->label = $label;
} }
public function outputTo(WriterInterface $writer) public function writeTo(WriterInterface $writer)
{ {
$this->source->outputAliasTo($writer); $this->source->writeAliasTo($writer);
$this->outputLinkTo($writer); $this->writeLinkTo($writer);
$this->target->outputAliasTo($writer); $this->target->writeAliasTo($writer);
$this->outputLabelTo($writer); $this->writeLabelTo($writer);
$writer->write("\n"); $writer->write("\n");
return $this; return $this;
} }
protected function outputLabelTo(WriterInterface $writer) protected function writeLabelTo(WriterInterface $writer)
{ {
if ($this->label) { if ($this->label) {
$writer->printf(" : %s", $this->label); $writer->printf(" : %s", $this->label);
...@@ -60,7 +60,7 @@ class BaseArrow implements ArrowInterface ...@@ -60,7 +60,7 @@ class BaseArrow implements ArrowInterface
return $this; return $this;
} }
protected function outputLinkTo(WriterInterface $writer) protected function writeLinkTo(WriterInterface $writer)
{ {
$writer->printf(" %s ", $this->link); $writer->printf(" %s ", $this->link);
return $this; return $this;
......
...@@ -119,8 +119,8 @@ class ClassVisitor implements ClassVisitorInterface ...@@ -119,8 +119,8 @@ class ClassVisitor implements ClassVisitorInterface
return new Class_($namespace, $className, $class->isAbstract(), $class->isFinal()); return new Class_($namespace, $className, $class->isAbstract(), $class->isFinal());
} }
public function outputTo(WriterInterface $writer) public function writeTo(WriterInterface $writer)
{ {
return $this->rootNamespace->outputTo($writer); return $this->rootNamespace->writeTo($writer);
} }
} }
...@@ -41,10 +41,10 @@ class Graph implements GraphInterface ...@@ -41,10 +41,10 @@ class Graph implements GraphInterface
} }
} }
public function outputTo(WriterInterface $writer) public function writeTo(WriterInterface $writer)
{ {
$writer->write("@startuml@\n"); $writer->write("@startuml@\n");
$this->visitor->outputTo($writer); $this->visitor->writeTo($writer);
$writer->write("@enduml@\n"); $writer->write("@enduml@\n");
return $this; return $this;
} }
......
...@@ -39,10 +39,10 @@ abstract class AbstractNamespace implements WritableInterface, NamespaceInterfac ...@@ -39,10 +39,10 @@ abstract class AbstractNamespace implements WritableInterface, NamespaceInterfac
* @param WriterInterface $writer * @param WriterInterface $writer
* @return self * @return self
*/ */
protected function outputNodesTo(WriterInterface $writer) protected function writeNodesTo(WriterInterface $writer)
{ {
foreach ($this->nodes as $node) { foreach ($this->nodes as $node) {
$node->outputTo($writer); $node->writeTo($writer);
} }
return $this; return $this;
} }
......
...@@ -31,19 +31,19 @@ class FlatNamespace extends AbstractNamespace ...@@ -31,19 +31,19 @@ class FlatNamespace extends AbstractNamespace
return $this; return $this;
} }
public function outputTo(WriterInterface $writer) public function writeTo(WriterInterface $writer)
{ {
$writer->printf("set namespaceSeparator %s\n", static::SEPARATOR); $writer->printf("set namespaceSeparator %s\n", static::SEPARATOR);
$this $this
->outputNodesTo($writer) ->writeNodesTo($writer)
->outputArrowsTo($writer); ->writeArrowsTo($writer);
return $this; return $this;
} }
protected function outputArrowsTo(WriterInterface $writer) protected function writeArrowsTo(WriterInterface $writer)
{ {
foreach ($this->arrows as $arrow) { foreach ($this->arrows as $arrow) {
$arrow->outputTo($writer); $arrow->writeTo($writer);
} }
return $this; return $this;
} }
......
...@@ -58,10 +58,10 @@ abstract class AbstractNamespace extends Base ...@@ -58,10 +58,10 @@ abstract class AbstractNamespace extends Base
* @param WriterInterface $writer * @param WriterInterface $writer
* @return self * @return self
*/ */
protected function outputChildrenTo(WriterInterface $writer) protected function writeChildrenTo(WriterInterface $writer)
{ {
foreach ($this->children as $child) { foreach ($this->children as $child) {
$child->outputTo($writer); $child->writeTo($writer);
} }
return $this; return $this;
} }
......
...@@ -65,7 +65,7 @@ class Namespace_ extends AbstractNamespace ...@@ -65,7 +65,7 @@ class Namespace_ extends AbstractNamespace
* @param resource WriterInterface $writer * @param resource WriterInterface $writer
* @return self * @return self
*/ */
public function outputTo(WriterInterface $writer) public function writeTo(WriterInterface $writer)
{ {
if ($this->isEmpty()) { if ($this->isEmpty()) {
return; return;
...@@ -75,8 +75,8 @@ class Namespace_ extends AbstractNamespace ...@@ -75,8 +75,8 @@ class Namespace_ extends AbstractNamespace
->printf("namespace %s {\n", $this->name) ->printf("namespace %s {\n", $this->name)
->indent(); ->indent();
$this $this
->outputNodesTo($writer) ->writeNodesTo($writer)
->outputChildrenTo($writer); ->writeChildrenTo($writer);
$writer $writer
->dedent() ->dedent()
->write("}\n"); ->write("}\n");
......
...@@ -29,20 +29,20 @@ class RootNamespace extends AbstractNamespace ...@@ -29,20 +29,20 @@ class RootNamespace extends AbstractNamespace
return $this; return $this;
} }
public function outputTo(WriterInterface $writer) public function writeTo(WriterInterface $writer)
{ {
$writer->write("set namespaceSeparator .\n"); $writer->write("set namespaceSeparator .\n");
$this $this
->outputNodesTo($writer) ->writeNodesTo($writer)
->outputChildrenTo($writer) ->writeChildrenTo($writer)
->outputArrowsTo($writer); ->writeArrowsTo($writer);
return $this; return $this;
} }
protected function outputArrowsTo(WriterInterface $writer) protected function writeArrowsTo(WriterInterface $writer)
{ {
foreach ($this->arrows as $arrow) { foreach ($this->arrows as $arrow) {
$arrow->outputTo($writer); $arrow->writeTo($writer);
} }
return $this; return $this;
} }
......
...@@ -86,33 +86,33 @@ class BaseNode implements NodeInterface ...@@ -86,33 +86,33 @@ class BaseNode implements NodeInterface
return $this; return $this;
} }
public function outputTo(WriterInterface $writer) public function writeTo(WriterInterface $writer)
{ {
$this $this
->outputClassifiersTo($writer) ->writeClassifiersTo($writer)
->outputNodeTypeTo($writer); ->writeNodeTypeTo($writer);
$writer->printf('"%s" as %s', $this->label, $this->id); $writer->printf('"%s" as %s', $this->label, $this->id);
$this $this
->outputStereotypesTo($writer); ->writeStereotypesTo($writer);
$writer $writer
->write(" {\n") ->write(" {\n")
->indent(); ->indent();
$this $this
->outputAttributesTo($writer) ->writeAttributesTo($writer)
->outputMethodsTo($writer); ->writeMethodsTo($writer);
$writer $writer
->dedent() ->dedent()
->write("}\n"); ->write("}\n");
return $this; return $this;
} }
public function outputAliasTo(WriterInterface $writer) public function writeAliasTo(WriterInterface $writer)
{ {
$writer->write($this->id); $writer->write($this->id);
return $this; return $this;
} }
protected function outputClassifiersTo(WriterInterface $writer) protected function writeClassifiersTo(WriterInterface $writer)
{ {
foreach($this->classifiers as $classifier) { foreach($this->classifiers as $classifier) {
$writer->printf('%s ', $classifier); $writer->printf('%s ', $classifier);
...@@ -120,13 +120,13 @@ class BaseNode implements NodeInterface ...@@ -120,13 +120,13 @@ class BaseNode implements NodeInterface
return $this; return $this;
} }
protected function outputNodeTypeTo(WriterInterface $writer) protected function writeNodeTypeTo(WriterInterface $writer)
{ {
$writer->printf('%s ', $this->nodeType); $writer->printf('%s ', $this->nodeType);
return $this; return $this;
} }
protected function outputStereotypesTo(WriterInterface $writer) protected function writeStereotypesTo(WriterInterface $writer)
{ {
foreach($this->stereotypes as $stereotype) { foreach($this->stereotypes as $stereotype) {
$writer->printf(' <<%s>>', $stereotype); $writer->printf(' <<%s>>', $stereotype);
...@@ -134,12 +134,12 @@ class BaseNode implements NodeInterface ...@@ -134,12 +134,12 @@ class BaseNode implements NodeInterface
return $this; return $this;
} }
protected function outputAttributesTo(WriterInterface $writer) protected function writeAttributesTo(WriterInterface $writer)
{ {
return $this; return $this;
} }
protected function outputMethodsTo(WriterInterface $writer) protected function writeMethodsTo(WriterInterface $writer)
{ {
return $this; return $this;
} }
......
...@@ -19,5 +19,5 @@ interface WritableInterface ...@@ -19,5 +19,5 @@ interface WritableInterface
/** /**
* @param WriterInterface $writer * @param WriterInterface $writer
*/ */
public function outputTo(WriterInterface $writer); public function writeTo(WriterInterface $writer);
} }
...@@ -19,5 +19,5 @@ interface WritableNodeInterface extends WritableInterface ...@@ -19,5 +19,5 @@ interface WritableNodeInterface extends WritableInterface
/** /**
* @param WriterInterface $writer * @param WriterInterface $writer
*/ */
public function outputAliasTo(WriterInterface $writer); public function writeAliasTo(WriterInterface $writer);
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment