diff --git a/Creational/StaticFactory/FormatNumber.php b/Creational/StaticFactory/FormatNumber.php index 69fd9e1..7579a92 100644 --- a/Creational/StaticFactory/FormatNumber.php +++ b/Creational/StaticFactory/FormatNumber.php @@ -2,6 +2,10 @@ namespace DesignPatterns\Creational\StaticFactory; -class FormatNumber implements FormatterInterface +class FormatNumber implements Formatter { + public function format(string $input): string + { + return number_format($input); + } } diff --git a/Creational/StaticFactory/FormatString.php b/Creational/StaticFactory/FormatString.php index 14c2055..41e7221 100644 --- a/Creational/StaticFactory/FormatString.php +++ b/Creational/StaticFactory/FormatString.php @@ -2,6 +2,10 @@ namespace DesignPatterns\Creational\StaticFactory; -class FormatString implements FormatterInterface +class FormatString implements Formatter { + public function format(string $input): string + { + return $input; + } } diff --git a/Creational/StaticFactory/Formatter.php b/Creational/StaticFactory/Formatter.php new file mode 100644 index 0000000..f6abe51 --- /dev/null +++ b/Creational/StaticFactory/Formatter.php @@ -0,0 +1,8 @@ + - - PHP - \DesignPatterns\Creational\StaticFactory\FormatNumber - - \DesignPatterns\Creational\StaticFactory\FormatNumber - \DesignPatterns\Creational\StaticFactory\StaticFactory - \DesignPatterns\Creational\StaticFactory\FormatString - \DesignPatterns\Creational\StaticFactory\FormatterInterface - - - - - - - - - - - - - - - - - - - - Fields - Constants - Constructors - Methods - - private - - + + + PHP + \DesignPatterns\Creational\StaticFactory\FormatNumber + + \DesignPatterns\Creational\StaticFactory\FormatString + \DesignPatterns\Creational\StaticFactory\StaticFactory + \DesignPatterns\Creational\StaticFactory\Formatter + \DesignPatterns\Creational\StaticFactory\FormatNumber + + + + + + + + + + + + + + + + + + + + Fields + Constants + Constructors + Methods + + private + + diff --git a/Creational/StaticFactory/uml/uml.png b/Creational/StaticFactory/uml/uml.png index f1b6688..7b833da 100644 Binary files a/Creational/StaticFactory/uml/uml.png and b/Creational/StaticFactory/uml/uml.png differ diff --git a/Creational/StaticFactory/uml/uml.svg b/Creational/StaticFactory/uml/uml.svg index e57a79b..2626370 100644 --- a/Creational/StaticFactory/uml/uml.svg +++ b/Creational/StaticFactory/uml/uml.svg @@ -1,207 +1,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FormatNumber - - - FormatNumber - - - - - - - - - - - - - - - - - - factory(type) - - - - - - - - - - - - - StaticFactory - - - StaticFactory - - - - - - - - - - - - - - - - FormatString - - - FormatString - - - - - - - - - - - - - - - - FormatterInterface - - - FormatterInterface - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +