The object property mText of the class TextContent is not declared, so it is implicitely public. The TextContent class is advertised as immutable, so it should be clear mText should not be externally modified.
But it would be better to declare the object property, either with @var @internal to keep its visibility public (for testing purposes), either with a protected or private visibility.
Existing code directly using this object property (there are some homonyms in ParserOutput and SearchResult, I hope I’ve not missed other non-false-positive occurences):
- extensions (in the Wikimedia code repository):
- WikiLexicalData (multiple occurences in includes/api/): only read, so it can be easily replaced by TextContent::getNativeData()
- core/tests:
- [RevisionTestModifyableContent](https://phabricator.wikimedia.org/diffusion/MW/browse/master/tests/phpunit/includes/RevisionTest.php) extending TextContent: read/write, so a private visibility will break this class