mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 12:10:10 +02:00
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.
This commit is contained in:
@@ -7,7 +7,7 @@ abstract class Text
|
|||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $text;
|
protected $text;
|
||||||
|
|
||||||
public function __construct(string $text)
|
public function __construct(string $text)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user