From a6e19bcf163f70fc906bb02c12f2a4e2f4c30e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr> Date: Fri, 11 Mar 2016 14:56:45 +0100 Subject: [PATCH] =?UTF-8?q?WritableInterface::outputTo=20renomm=C3=A9e=20e?= =?UTF-8?q?n=20WritableInterface::writeTo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Et de même pour toutes les méthodes write*To. --- Command/GenerateCommand.php | 2 +- Model/Arrow/BaseArrow.php | 14 ++++++------- Model/ClassVisitor.php | 4 ++-- Model/Graph.php | 4 ++-- Model/Namespace_/AbstractNamespace.php | 4 ++-- Model/Namespace_/FlatNamespace.php | 10 ++++----- Model/Namespace_/Php/AbstractNamespace.php | 4 ++-- Model/Namespace_/Php/Namespace_.php | 6 +++--- Model/Namespace_/Php/RootNamespace.php | 12 +++++------ Model/Node/BaseNode.php | 24 +++++++++++----------- Writer/WritableInterface.php | 2 +- Writer/WritableNodeInterface.php | 2 +- 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Command/GenerateCommand.php b/Command/GenerateCommand.php index d274835..64eaba0 100644 --- a/Command/GenerateCommand.php +++ b/Command/GenerateCommand.php @@ -115,7 +115,7 @@ class GenerateCommand extends ContainerAwareCommand $graph->visitAll(); $writer = new OutputWriter($output); - $graph->outputTo($writer); + $graph->writeTo($writer); } /** diff --git a/Model/Arrow/BaseArrow.php b/Model/Arrow/BaseArrow.php index f281c23..7d9893e 100644 --- a/Model/Arrow/BaseArrow.php +++ b/Model/Arrow/BaseArrow.php @@ -42,17 +42,17 @@ class BaseArrow implements ArrowInterface $this->label = $label; } - public function outputTo(WriterInterface $writer) + public function writeTo(WriterInterface $writer) { - $this->source->outputAliasTo($writer); - $this->outputLinkTo($writer); - $this->target->outputAliasTo($writer); - $this->outputLabelTo($writer); + $this->source->writeAliasTo($writer); + $this->writeLinkTo($writer); + $this->target->writeAliasTo($writer); + $this->writeLabelTo($writer); $writer->write("\n"); return $this; } - protected function outputLabelTo(WriterInterface $writer) + protected function writeLabelTo(WriterInterface $writer) { if ($this->label) { $writer->printf(" : %s", $this->label); @@ -60,7 +60,7 @@ class BaseArrow implements ArrowInterface return $this; } - protected function outputLinkTo(WriterInterface $writer) + protected function writeLinkTo(WriterInterface $writer) { $writer->printf(" %s ", $this->link); return $this; diff --git a/Model/ClassVisitor.php b/Model/ClassVisitor.php index c793cf1..71d402f 100644 --- a/Model/ClassVisitor.php +++ b/Model/ClassVisitor.php @@ -119,8 +119,8 @@ class ClassVisitor implements ClassVisitorInterface 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); } } diff --git a/Model/Graph.php b/Model/Graph.php index 9442c1f..a049540 100644 --- a/Model/Graph.php +++ b/Model/Graph.php @@ -41,10 +41,10 @@ class Graph implements GraphInterface } } - public function outputTo(WriterInterface $writer) + public function writeTo(WriterInterface $writer) { $writer->write("@startuml@\n"); - $this->visitor->outputTo($writer); + $this->visitor->writeTo($writer); $writer->write("@enduml@\n"); return $this; } diff --git a/Model/Namespace_/AbstractNamespace.php b/Model/Namespace_/AbstractNamespace.php index db728ea..c65d05e 100644 --- a/Model/Namespace_/AbstractNamespace.php +++ b/Model/Namespace_/AbstractNamespace.php @@ -39,10 +39,10 @@ abstract class AbstractNamespace implements WritableInterface, NamespaceInterfac * @param WriterInterface $writer * @return self */ - protected function outputNodesTo(WriterInterface $writer) + protected function writeNodesTo(WriterInterface $writer) { foreach ($this->nodes as $node) { - $node->outputTo($writer); + $node->writeTo($writer); } return $this; } diff --git a/Model/Namespace_/FlatNamespace.php b/Model/Namespace_/FlatNamespace.php index 587fb8d..362e794 100644 --- a/Model/Namespace_/FlatNamespace.php +++ b/Model/Namespace_/FlatNamespace.php @@ -31,19 +31,19 @@ class FlatNamespace extends AbstractNamespace return $this; } - public function outputTo(WriterInterface $writer) + public function writeTo(WriterInterface $writer) { $writer->printf("set namespaceSeparator %s\n", static::SEPARATOR); $this - ->outputNodesTo($writer) - ->outputArrowsTo($writer); + ->writeNodesTo($writer) + ->writeArrowsTo($writer); return $this; } - protected function outputArrowsTo(WriterInterface $writer) + protected function writeArrowsTo(WriterInterface $writer) { foreach ($this->arrows as $arrow) { - $arrow->outputTo($writer); + $arrow->writeTo($writer); } return $this; } diff --git a/Model/Namespace_/Php/AbstractNamespace.php b/Model/Namespace_/Php/AbstractNamespace.php index d0ba86c..10756b0 100644 --- a/Model/Namespace_/Php/AbstractNamespace.php +++ b/Model/Namespace_/Php/AbstractNamespace.php @@ -58,10 +58,10 @@ abstract class AbstractNamespace extends Base * @param WriterInterface $writer * @return self */ - protected function outputChildrenTo(WriterInterface $writer) + protected function writeChildrenTo(WriterInterface $writer) { foreach ($this->children as $child) { - $child->outputTo($writer); + $child->writeTo($writer); } return $this; } diff --git a/Model/Namespace_/Php/Namespace_.php b/Model/Namespace_/Php/Namespace_.php index 7fff4a5..279a089 100644 --- a/Model/Namespace_/Php/Namespace_.php +++ b/Model/Namespace_/Php/Namespace_.php @@ -65,7 +65,7 @@ class Namespace_ extends AbstractNamespace * @param resource WriterInterface $writer * @return self */ - public function outputTo(WriterInterface $writer) + public function writeTo(WriterInterface $writer) { if ($this->isEmpty()) { return; @@ -75,8 +75,8 @@ class Namespace_ extends AbstractNamespace ->printf("namespace %s {\n", $this->name) ->indent(); $this - ->outputNodesTo($writer) - ->outputChildrenTo($writer); + ->writeNodesTo($writer) + ->writeChildrenTo($writer); $writer ->dedent() ->write("}\n"); diff --git a/Model/Namespace_/Php/RootNamespace.php b/Model/Namespace_/Php/RootNamespace.php index 7b07b8b..bf94bf2 100644 --- a/Model/Namespace_/Php/RootNamespace.php +++ b/Model/Namespace_/Php/RootNamespace.php @@ -29,20 +29,20 @@ class RootNamespace extends AbstractNamespace return $this; } - public function outputTo(WriterInterface $writer) + public function writeTo(WriterInterface $writer) { $writer->write("set namespaceSeparator .\n"); $this - ->outputNodesTo($writer) - ->outputChildrenTo($writer) - ->outputArrowsTo($writer); + ->writeNodesTo($writer) + ->writeChildrenTo($writer) + ->writeArrowsTo($writer); return $this; } - protected function outputArrowsTo(WriterInterface $writer) + protected function writeArrowsTo(WriterInterface $writer) { foreach ($this->arrows as $arrow) { - $arrow->outputTo($writer); + $arrow->writeTo($writer); } return $this; } diff --git a/Model/Node/BaseNode.php b/Model/Node/BaseNode.php index 1be3396..5878209 100644 --- a/Model/Node/BaseNode.php +++ b/Model/Node/BaseNode.php @@ -86,33 +86,33 @@ class BaseNode implements NodeInterface return $this; } - public function outputTo(WriterInterface $writer) + public function writeTo(WriterInterface $writer) { $this - ->outputClassifiersTo($writer) - ->outputNodeTypeTo($writer); + ->writeClassifiersTo($writer) + ->writeNodeTypeTo($writer); $writer->printf('"%s" as %s', $this->label, $this->id); $this - ->outputStereotypesTo($writer); + ->writeStereotypesTo($writer); $writer ->write(" {\n") ->indent(); $this - ->outputAttributesTo($writer) - ->outputMethodsTo($writer); + ->writeAttributesTo($writer) + ->writeMethodsTo($writer); $writer ->dedent() ->write("}\n"); return $this; } - public function outputAliasTo(WriterInterface $writer) + public function writeAliasTo(WriterInterface $writer) { $writer->write($this->id); return $this; } - protected function outputClassifiersTo(WriterInterface $writer) + protected function writeClassifiersTo(WriterInterface $writer) { foreach($this->classifiers as $classifier) { $writer->printf('%s ', $classifier); @@ -120,13 +120,13 @@ class BaseNode implements NodeInterface return $this; } - protected function outputNodeTypeTo(WriterInterface $writer) + protected function writeNodeTypeTo(WriterInterface $writer) { $writer->printf('%s ', $this->nodeType); return $this; } - protected function outputStereotypesTo(WriterInterface $writer) + protected function writeStereotypesTo(WriterInterface $writer) { foreach($this->stereotypes as $stereotype) { $writer->printf(' <<%s>>', $stereotype); @@ -134,12 +134,12 @@ class BaseNode implements NodeInterface return $this; } - protected function outputAttributesTo(WriterInterface $writer) + protected function writeAttributesTo(WriterInterface $writer) { return $this; } - protected function outputMethodsTo(WriterInterface $writer) + protected function writeMethodsTo(WriterInterface $writer) { return $this; } diff --git a/Writer/WritableInterface.php b/Writer/WritableInterface.php index 50fa5aa..fd27210 100644 --- a/Writer/WritableInterface.php +++ b/Writer/WritableInterface.php @@ -19,5 +19,5 @@ interface WritableInterface /** * @param WriterInterface $writer */ - public function outputTo(WriterInterface $writer); + public function writeTo(WriterInterface $writer); } diff --git a/Writer/WritableNodeInterface.php b/Writer/WritableNodeInterface.php index cc89d28..957cfc6 100644 --- a/Writer/WritableNodeInterface.php +++ b/Writer/WritableNodeInterface.php @@ -19,5 +19,5 @@ interface WritableNodeInterface extends WritableInterface /** * @param WriterInterface $writer */ - public function outputAliasTo(WriterInterface $writer); + public function writeAliasTo(WriterInterface $writer); } -- GitLab