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:
Kerem Güneş
2017-12-09 21:21:37 +03:00
parent d9ca300f3f
commit bfe62d5f1a

View File

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