Merge pull request #309 from k-gun/master

The "protected" keyword should be used in order to subclasses to use …
This commit is contained in:
Piotr Grabski-Gradziński
2017-12-11 10:17:36 +01:00
committed by GitHub
6 changed files with 9 additions and 9 deletions

View File

@@ -7,7 +7,7 @@ abstract class Text
/**
* @var string
*/
private $text;
protected $text;
public function __construct(string $text)
{

View File

@@ -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

View File

@@ -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.

View File

@@ -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 ""

View File

@@ -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

View File

@@ -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."