From bfe62d5f1a9d6eac106aba0733d7404ad6622ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kerem=20G=C3=BCne=C5=9F?= Date: Sat, 9 Dec 2017 21:21:37 +0300 Subject: [PATCH 1/3] The "protected" keyword should be used in order to subclasses to use that property. Otherwise, saying "$this->text = $text" is not making sense for extender objects. --- Creational/AbstractFactory/Text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Creational/AbstractFactory/Text.php b/Creational/AbstractFactory/Text.php index 60846bb..3573801 100644 --- a/Creational/AbstractFactory/Text.php +++ b/Creational/AbstractFactory/Text.php @@ -7,7 +7,7 @@ abstract class Text /** * @var string */ - private $text; + protected $text; public function __construct(string $text) { From 4bc5a3d7a2be8ed3560662c165086a37ef5ba28e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kerem=20G=C3=BCne=C5=9F?= Date: Sun, 10 Dec 2017 04:38:26 +0300 Subject: [PATCH 2/3] Fix typo (parametrized => parameterized). Didn't touch other translations due to encoding corruption. --- Creational/SimpleFactory/README.rst | 2 +- locale/ca/LC_MESSAGES/Creational/SimpleFactory/README.po | 4 ++-- .../template/LC_MESSAGES/Creational/SimpleFactory/README.pot | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Creational/SimpleFactory/README.rst b/Creational/SimpleFactory/README.rst index 3ef9f0e..1a10f3c 100644 --- a/Creational/SimpleFactory/README.rst +++ b/Creational/SimpleFactory/README.rst @@ -7,7 +7,7 @@ Purpose SimpleFactory is a simple factory pattern. It differs from the static factory because it is not static. -Therefore, you can have multiple factories, differently parametrized, you can subclass it and you can mock it. +Therefore, you can have multiple factories, differently parameterized, you can subclass it and you can mock it. It always should be preferred over a static factory! UML Diagram diff --git a/locale/ca/LC_MESSAGES/Creational/SimpleFactory/README.po b/locale/ca/LC_MESSAGES/Creational/SimpleFactory/README.po index 6501749..751085e 100644 --- a/locale/ca/LC_MESSAGES/Creational/SimpleFactory/README.po +++ b/locale/ca/LC_MESSAGES/Creational/SimpleFactory/README.po @@ -1,4 +1,4 @@ -# +# msgid "" msgstr "" "Project-Id-Version: DesignPatternsPHP 1.0\n" @@ -31,7 +31,7 @@ msgstr "" #: ../../Creational/SimpleFactory/README.rst:12 msgid "" -"Therefore, you can have multiple factories, differently parametrized, you " +"Therefore, you can have multiple factories, differently parameterized, you " "can subclass it and you can mock-up it." msgstr "" diff --git a/locale/template/LC_MESSAGES/Creational/SimpleFactory/README.pot b/locale/template/LC_MESSAGES/Creational/SimpleFactory/README.pot index 7af53ee..8c59113 100644 --- a/locale/template/LC_MESSAGES/Creational/SimpleFactory/README.pot +++ b/locale/template/LC_MESSAGES/Creational/SimpleFactory/README.pot @@ -23,7 +23,7 @@ msgstr "" #: ../../Creational/SimpleFactory/README.rst:9 msgid "" "It differs from the static factory because it is not static. " -"Therefore, you can have multiple factories, differently parametrized, you can subclass it and you can mock it." +"Therefore, you can have multiple factories, differently parameterized, you can subclass it and you can mock it." msgstr "" #: ../../Creational/SimpleFactory/README.rst:11 @@ -52,4 +52,4 @@ msgstr "" #: ../../Creational/SimpleFactory/README.rst:52 msgid "Test" -msgstr "" \ No newline at end of file +msgstr "" From 26eb70713a73ff2084767e498ec05205304fd5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kerem=20G=C3=BCne=C5=9F?= Date: Mon, 11 Dec 2017 05:15:34 +0300 Subject: [PATCH 3/3] Add markdown flavors for objects. --- Structural/DependencyInjection/README.rst | 2 +- .../LC_MESSAGES/Structural/DependencyInjection/README.pot | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Structural/DependencyInjection/README.rst b/Structural/DependencyInjection/README.rst index 1fa36d5..56f9858 100644 --- a/Structural/DependencyInjection/README.rst +++ b/Structural/DependencyInjection/README.rst @@ -10,7 +10,7 @@ testable, maintainable and extendable code. Usage ----- -DatabaseConfiguration gets injected and ``DatabaseConnection`` will get all that it +``DatabaseConfiguration`` gets injected and ``DatabaseConnection`` will get all that it needs from ``$config``. Without DI, the configuration would be created directly in ``DatabaseConnection``, which is not very good for testing and extending it. diff --git a/locale/template/LC_MESSAGES/Structural/DependencyInjection/README.pot b/locale/template/LC_MESSAGES/Structural/DependencyInjection/README.pot index bbf9186..87996d9 100644 --- a/locale/template/LC_MESSAGES/Structural/DependencyInjection/README.pot +++ b/locale/template/LC_MESSAGES/Structural/DependencyInjection/README.pot @@ -28,7 +28,7 @@ msgstr "" #: ../../Structural/DependencyInjection/README.rst:13 msgid "" -"DatabaseConfiguration gets injected and ``DatabaseConnection`` will get all that it " +"``DatabaseConfiguration`` gets injected and ``DatabaseConnection`` will get all that it " "needs from ``$config``. Without DI, the configuration would be created " "directly in ``DatabaseConnection``, which is not very good for testing and " "extending it." @@ -71,4 +71,4 @@ msgstr "" #: ../../Structural/DependencyInjection/README.rst:53 msgid "Test" -msgstr "" \ No newline at end of file +msgstr ""